diff options
Diffstat (limited to 'bundle-uri.c')
| -rw-r--r-- | bundle-uri.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/bundle-uri.c b/bundle-uri.c index dc0c96955b..744257c49c 100644 --- a/bundle-uri.c +++ b/bundle-uri.c @@ -1,10 +1,10 @@ #define USE_THE_REPOSITORY_VARIABLE +#define DISABLE_SIGN_COMPARE_WARNINGS #include "git-compat-util.h" #include "bundle-uri.h" #include "bundle.h" #include "copy.h" -#include "environment.h" #include "gettext.h" #include "refs.h" #include "run-command.h" @@ -14,6 +14,7 @@ #include "fetch-pack.h" #include "remote.h" #include "trace2.h" +#include "object-store-ll.h" static struct { enum bundle_list_heuristic heuristic; @@ -367,18 +368,27 @@ static int unbundle_from_file(struct repository *r, const char *file) struct string_list_item *refname; struct strbuf bundle_ref = STRBUF_INIT; size_t bundle_prefix_len; + struct unbundle_opts opts = { + .flags = VERIFY_BUNDLE_QUIET | + (fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0), + }; - if ((bundle_fd = read_bundle_header(file, &header)) < 0) - return 1; + bundle_fd = read_bundle_header(file, &header); + if (bundle_fd < 0) { + result = 1; + goto cleanup; + } /* * Skip the reachability walk here, since we will be adding * a reachable ref pointing to the new tips, which will reach * the prerequisite commits. */ - if ((result = unbundle(r, &header, bundle_fd, NULL, - VERIFY_BUNDLE_QUIET | (fetch_pack_fsck_objects() ? VERIFY_BUNDLE_FSCK : 0)))) - return 1; + result = unbundle(r, &header, bundle_fd, NULL, &opts); + if (result) { + result = 1; + goto cleanup; + } /* * Convert all refs/heads/ from the bundle into refs/bundles/ @@ -407,6 +417,8 @@ static int unbundle_from_file(struct repository *r, const char *file) 0, UPDATE_REFS_MSG_ON_ERR); } +cleanup: + strbuf_release(&bundle_ref); bundle_header_release(&header); return result; } |
