Merge branch 'fc/fetch-with-import-fix'
authorJunio C Hamano <gitster@pobox.com>
Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Jul 2019 22:25:34 +0000 (15:25 -0700)
Code restructuring during 2.20 period broke fetching tags via
"import" based transports.

* fc/fetch-with-import-fix:
  fetch: fix regression with transport helpers
  fetch: make the code more understandable
  fetch: trivial cleanup
  t5801 (remote-helpers): add test to fetch tags
  t5801 (remote-helpers): cleanup refspec stuff

1  2 
builtin/fetch.c
t/t5801-remote-helpers.sh
t/t5801/git-remote-testgit

diff --cc builtin/fetch.c
@@@ -317,9 -321,10 +323,9 @@@ static void find_non_local_tags(const s
                            !has_object_file_with_flags(&ref->old_oid,
                                                        OBJECT_INFO_QUICK) &&
                            !will_fetch(head, ref->old_oid.hash) &&
 -                          !has_sha1_file_with_flags(item->oid.hash,
 -                                                    OBJECT_INFO_QUICK) &&
 +                          !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
                            !will_fetch(head, item->oid.hash))
-                               oidclr(&item->oid);
+                               clear_item(item);
                        item = NULL;
                        continue;
                }
                 * fetch.
                 */
                if (item &&
 -                  !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
 +                  !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
                    !will_fetch(head, item->oid.hash))
-                       oidclr(&item->oid);
+                       clear_item(item);
  
                item = NULL;
  
         * checked to see if it needs fetching.
         */
        if (item &&
 -          !has_sha1_file_with_flags(item->oid.hash, OBJECT_INFO_QUICK) &&
 +          !has_object_file_with_flags(&item->oid, OBJECT_INFO_QUICK) &&
            !will_fetch(head, item->oid.hash))
-               oidclr(&item->oid);
+               clear_item(item);
  
        /*
         * For all the tags in the remote_refs_list,
Simple merge
Simple merge