diff options
-rw-r--r-- | commit.c | 3 | ||||
-rwxr-xr-x | t/t5300-pack-object.sh | 6 |
2 files changed, 9 insertions, 0 deletions
@@ -196,6 +196,9 @@ static void prepare_commit_graft(void) if (commit_graft_prepared) return; + if (!startup_info->have_repository) + return; + graft_file = get_graft_file(); read_graft_file(graft_file); /* make sure shallows are read */ diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 9c68b99251..88ec5d7848 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -421,6 +421,12 @@ test_expect_success 'index-pack <pack> works in non-repo' ' test_path_is_file foo.idx ' +test_expect_success 'index-pack --strict <pack> works in non-repo' ' + rm -f foo.idx && + nongit git index-pack --strict ../foo.pack && + test_path_is_file foo.idx +' + test_expect_success !PTHREADS,C_LOCALE_OUTPUT 'index-pack --threads=N or pack.threads=N warns when no pthreads' ' test_must_fail git index-pack --threads=2 2>err && grep ^warning: err >warnings && |