]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ps/fetch-atomic'
authorJunio C Hamano <gitster@pobox.com>
Sun, 13 Mar 2022 22:56:16 +0000 (22:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Mar 2022 22:56:16 +0000 (22:56 +0000)
"git fetch" can make two separate fetches, but ref updates coming
from them were in two separate ref transactions under "--atomic",
which has been corrected.

* ps/fetch-atomic:
  fetch: make `--atomic` flag cover pruning of refs
  fetch: make `--atomic` flag cover backfilling of tags
  refs: add interface to iterate over queued transactional updates
  fetch: report errors when backfilling tags fails
  fetch: control lifecycle of FETCH_HEAD in a single place
  fetch: backfill tags before setting upstream
  fetch: increase test coverage of fetches

1  2 
builtin/fetch.c
refs.c
refs.h

diff --cc builtin/fetch.c
index 95832ba1dfd00f6da07a53509aac20f6e8b70295,9a2b5c03a4b99ef0c9139565eedaf5f4167af849..e8305b6662c24f8bab152797078d816452528e06
@@@ -1094,14 -1115,7 +1115,10 @@@ static int store_updated_refs(const cha
        struct ref *rm;
        char *url;
        int want_status;
 -      int summary_width = transport_summary_width(ref_map);
 +      int summary_width = 0;
 +
-       rc = open_fetch_head(&fetch_head);
-       if (rc)
-               return -1;
 +      if (verbosity >= 0)
 +              summary_width = transport_summary_width(ref_map);
  
        if (raw_url)
                url = transport_anonymize_url(raw_url);
@@@ -1347,7 -1345,9 +1348,8 @@@ static int prune_refs(struct refspec *r
  {
        int url_len, i, result = 0;
        struct ref *ref, *stale_refs = get_stale_heads(rs, ref_map);
+       struct strbuf err = STRBUF_INIT;
        char *url;
 -      int summary_width = transport_summary_width(stale_refs);
        const char *dangling_msg = dry_run
                ? _("   (%s will become dangling)")
                : _("   (%s has become dangling)");
diff --cc refs.c
Simple merge
diff --cc refs.h
Simple merge