Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-06-17 20:15:16 +0300
committerJunio C Hamano <gitster@pobox.com>2019-06-17 20:15:16 +0300
commit3a54d80ac8a1decac6fa158175fb16f0563f5c15 (patch)
treec03c5ef49769d02e8d20558ffbb8017613e38b87
parent5b476dc2f13324852d0dbf7f2e5c020d1064ac8c (diff)
parent3bbbe467f294fae8a286e47af676fa783ad970c1 (diff)
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
-rw-r--r--bundle.c3
-rwxr-xr-xt/t5607-clone-bundle.sh6
2 files changed, 9 insertions, 0 deletions
diff --git a/bundle.c b/bundle.c
index b45666c49b..b5d21cd80f 100644
--- a/bundle.c
+++ b/bundle.c
@@ -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;
diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh
index cf39e9e243..2a0fb15cf1 100755
--- a/t/t5607-clone-bundle.sh
+++ b/t/t5607-clone-bundle.sh
@@ -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 &&