diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-09-15 12:39:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-09-15 12:39:22 -0700 |
commit | d42cb5804f9c52b88b6dfe709a659e31394ea2ae (patch) | |
tree | 097a23aa9d5dc1f729877aa51973dcb5d0af5608 | |
parent | 9f0ccb5b0ac067b3408d3776bb06f85acd4a1e7e (diff) | |
parent | 0f5cdf653b8be5b8fad3fb2a3eaecfb9da80d215 (diff) | |
download | git-d42cb5804f9c52b88b6dfe709a659e31394ea2ae.tar.gz git-d42cb5804f9c52b88b6dfe709a659e31394ea2ae.tar.xz |
Merge branch 'ch/maint-cannot-create-bundle-error'
* ch/maint-cannot-create-bundle-error:
bundle: detect if bundle file cannot be created
-rw-r--r-- | bundle.c | 6 | ||||
-rwxr-xr-x | t/t5704-bundle.sh | 7 |
2 files changed, 11 insertions, 2 deletions
@@ -372,8 +372,10 @@ int create_bundle(struct bundle_header *header, const char *path, close(rls.in); if (finish_command(&rls)) return error ("pack-objects died"); - if (!bundle_to_stdout) - commit_lock_file(&lock); + if (!bundle_to_stdout) { + if (commit_lock_file(&lock)) + die_errno("cannot create '%s'", path); + } return 0; } diff --git a/t/t5704-bundle.sh b/t/t5704-bundle.sh index ddc3dc52f..728ccd88c 100755 --- a/t/t5704-bundle.sh +++ b/t/t5704-bundle.sh @@ -30,6 +30,13 @@ test_expect_success 'tags can be excluded by rev-list options' ' ' +test_expect_success 'die if bundle file cannot be created' ' + + mkdir adir && + test_must_fail git bundle create adir --all + +' + test_expect_failure 'bundle --stdin' ' echo master | git bundle create stdin-bundle.bdl --stdin && |