Merge branch 'ch/maint-cannot-create-bundle-error'

* ch/maint-cannot-create-bundle-error:
  bundle: detect if bundle file cannot be created
This commit is contained in:
Junio C Hamano 2010-09-15 12:39:22 -07:00
commit d42cb5804f
2 changed files with 11 additions and 2 deletions

View File

@ -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;
}

View File

@ -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 &&