diff --git a/bundle.c b/bundle.c index f55a521b2a..aad5f251ca 100644 --- a/bundle.c +++ b/bundle.c @@ -492,7 +492,7 @@ int create_bundle(struct repository *r, const char *path, int bundle_fd = -1; int bundle_to_stdout; int ref_count = 0; - struct rev_info revs, revs_copy; + struct rev_info revs, revs_copy = { 0 }; int min_version = 2; struct bundle_prerequisites_info bpi; int ret; diff --git a/t/t5607-clone-bundle.sh b/t/t5607-clone-bundle.sh index d709bea753..c39db5a955 100755 --- a/t/t5607-clone-bundle.sh +++ b/t/t5607-clone-bundle.sh @@ -127,6 +127,13 @@ test_expect_success 'failed bundle creation does not leave cruft' ' test_path_is_missing fail.bundle.lock ' +test_expect_success 'an unknown argument after the revisions is an error' ' + test_must_fail git bundle create unknown.bundle main --no-such-option \ + 2>err && + test_grep "unrecognized argument: --no-such-option" err && + test_path_is_missing unknown.bundle +' + test_expect_success 'fetch SHA-1 from bundle' ' test_create_repo foo && test_commit -C foo x &&