Skip to content

Commit

Permalink
Merge branch 'ch/maint-cannot-create-bundle-error'
Browse files Browse the repository at this point in the history
* ch/maint-cannot-create-bundle-error:
  bundle: detect if bundle file cannot be created
  • Loading branch information
Junio C Hamano committed Sep 15, 2010
2 parents 9f0ccb5 + 0f5cdf6 commit d42cb58
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 7 additions & 0 deletions t/t5704-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit d42cb58

Please sign in to comment.