diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-09-12 11:02:16 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-12 11:02:16 -0700 |
| commit | b4e826a7203a6cc1152d84df818f79456eaba457 (patch) | |
| tree | b3dc70ceabedf7039387e0ce4ceb6d426fc714df /builtin | |
| parent | 41c952ebacf7e3369e7bee721f768114d65e50c4 (diff) | |
| parent | 96a9a3e42e85874ba5edfcf86d91f7d8c05d5f94 (diff) | |
| download | git-b4e826a7203a6cc1152d84df818f79456eaba457.tar.xz | |
Merge branch 'ps/bundle-outside-repo-fix' into maint-2.46
"git bundle unbundle" outside a repository triggered a BUG()
unnecessarily, which has been corrected.
* ps/bundle-outside-repo-fix:
bundle: default to SHA1 when reading bundle headers
builtin/bundle: have unbundle check for repo before opening its bundle
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/bundle.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c index d5d41a8f67..86d0ed7049 100644 --- a/builtin/bundle.c +++ b/builtin/bundle.c @@ -207,12 +207,13 @@ static int cmd_bundle_unbundle(int argc, const char **argv, const char *prefix) builtin_bundle_unbundle_usage, options, &bundle_file); /* bundle internals use argv[1] as further parameters */ + if (!startup_info->have_repository) + die(_("Need a repository to unbundle.")); + if ((bundle_fd = open_bundle(bundle_file, &header, NULL)) < 0) { ret = 1; goto cleanup; } - if (!startup_info->have_repository) - die(_("Need a repository to unbundle.")); if (progress) strvec_pushl(&extra_index_pack_args, "-v", "--progress-title", _("Unbundling objects"), NULL); |
