Skip to content

Commit 3a54d80

Browse files
committed
Merge branch 'js/bundle-verify-require-object-store'
"git bundle verify" needs to see if prerequisite objects exist in the receiving repository, but the command did not check if we are in a repository upfront, which has been corrected. * js/bundle-verify-require-object-store: bundle verify: error out if called without an object database
2 parents 5b476dc + 3bbbe46 commit 3a54d80

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

bundle.c

+3
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ int verify_bundle(struct repository *r,
142142
int i, ret = 0, req_nr;
143143
const char *message = _("Repository lacks these prerequisite commits:");
144144

145+
if (!r || !r->objects || !r->objects->odb)
146+
return error(_("need a repository to verify a bundle"));
147+
145148
repo_init_revisions(r, &revs, NULL);
146149
for (i = 0; i < p->nr; i++) {
147150
struct ref_list_entry *e = p->list + i;

t/t5607-clone-bundle.sh

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ test_expect_success 'setup' '
1414
git tag -d third
1515
'
1616

17+
test_expect_success '"verify" needs a worktree' '
18+
git bundle create tip.bundle -1 master &&
19+
test_must_fail nongit git bundle verify ../tip.bundle 2>err &&
20+
test_i18ngrep "need a repository" err
21+
'
22+
1723
test_expect_success 'annotated tags can be excluded by rev-list options' '
1824
git bundle create bundle --all --since=7.Apr.2005.15:14:00.-0700 &&
1925
git ls-remote bundle > output &&

0 commit comments

Comments
 (0)