Skip to content

Instantly share code, notes, and snippets.

@tmiller
Created November 27, 2013 03:14
Show Gist options
  • Save tmiller/7670139 to your computer and use it in GitHub Desktop.
Save tmiller/7670139 to your computer and use it in GitHub Desktop.
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 5647055..b67a350 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -810,11 +810,6 @@ static int do_fetch(struct transport *transport,
if (tags == TAGS_DEFAULT && autotags)
transport_set_option(transport, TRANS_OPT_FOLLOWTAGS, "1");
- if (fetch_refs(transport, ref_map)) {
- free_refs(ref_map);
- retcode = 1;
- goto cleanup;
- }
if (prune) {
/* If --tags was specified, pretend the user gave us the canonical tags refspec */
if (tags == TAGS_SET) {
@@ -840,6 +835,11 @@ static int do_fetch(struct transport *transport,
prune_refs(transport->remote->fetch, transport->remote->fetch_refspec_nr, ref_map);
}
}
+ if (fetch_refs(transport, ref_map)) {
+ free_refs(ref_map);
+ retcode = 1;
+ goto cleanup;
+ }
free_refs(ref_map);
/* if neither --no-tags nor --tags was specified, do automated tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment