提交 abbd5042 编写于 作者: J Junio C Hamano

Merge branch 'js/bundle-verify-require-object-store' into maint

"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
......@@ -142,6 +142,9 @@ int verify_bundle(struct repository *r,
int i, ret = 0, req_nr;
const char *message = _("Repository lacks these prerequisite commits:");
if (!r || !r->objects || !r->objects->odb)
return error(_("need a repository to verify a bundle"));
repo_init_revisions(r, &revs, NULL);
for (i = 0; i < p->nr; i++) {
struct ref_list_entry *e = p->list + i;
......
......@@ -14,6 +14,12 @@ test_expect_success 'setup' '
git tag -d third
'
test_expect_success '"verify" needs a worktree' '
git bundle create tip.bundle -1 master &&
test_must_fail nongit git bundle verify ../tip.bundle 2>err &&
test_i18ngrep "need a repository" err
'
test_expect_success 'annotated tags can be excluded by rev-list options' '
git bundle create bundle --all --since=7.Apr.2005.15:14:00.-0700 &&
git ls-remote bundle > output &&
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册