summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b67e0d)
raw | patch | inline | side by side (parent: 6b67e0d)
author | Tay Ray Chuan <rctay89@gmail.com> | |
Fri, 7 Oct 2011 07:40:22 +0000 (15:40 +0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 7 Oct 2011 23:15:02 +0000 (16:15 -0700) |
Close FETCH_HEAD and release the string url even if we have to leave the
function store_updated_refs() early.
Reported-by: Chris Wilson <cwilson@vigilantsw.com>
Helped-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
function store_updated_refs() early.
Reported-by: Chris Wilson <cwilson@vigilantsw.com>
Helped-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c | patch | blob | history |
diff --git a/builtin/fetch.c b/builtin/fetch.c
index bdb03ff54c51426f4c814dc7326e62b0bc3576c5..db2c5d905b4c584bc1a9fd60392930e239fbd615 100644 (file)
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
else
url = xstrdup("foreign");
- if (check_everything_connected(ref_map, 0))
- return error(_("%s did not send all necessary objects\n"), url);
+ if (check_everything_connected(ref_map, 0)) {
+ rc = error(_("%s did not send all necessary objects\n"), url);
+ goto abort;
+ }
for (rm = ref_map; rm; rm = rm->next) {
struct ref *ref = NULL;
fprintf(stderr, " %s\n", note);
}
}
- free(url);
- fclose(fp);
+
if (rc & STORE_REF_ERROR_DF_CONFLICT)
error(_("some local refs could not be updated; try running\n"
" 'git remote prune %s' to remove any old, conflicting "
"branches"), remote_name);
+
+ abort:
+ free(url);
+ fclose(fp);
return rc;
}