Skip to content

Commit d42cb58

Browse files
committed
Merge branch 'ch/maint-cannot-create-bundle-error'
* ch/maint-cannot-create-bundle-error: bundle: detect if bundle file cannot be created
2 parents 9f0ccb5 + 0f5cdf6 commit d42cb58

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bundle.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ int create_bundle(struct bundle_header *header, const char *path,
372372
close(rls.in);
373373
if (finish_command(&rls))
374374
return error ("pack-objects died");
375-
if (!bundle_to_stdout)
376-
commit_lock_file(&lock);
375+
if (!bundle_to_stdout) {
376+
if (commit_lock_file(&lock))
377+
die_errno("cannot create '%s'", path);
378+
}
377379
return 0;
378380
}
379381

t/t5704-bundle.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@ test_expect_success 'tags can be excluded by rev-list options' '
3030
3131
'
3232

33+
test_expect_success 'die if bundle file cannot be created' '
34+
35+
mkdir adir &&
36+
test_must_fail git bundle create adir --all
37+
38+
'
39+
3340
test_expect_failure 'bundle --stdin' '
3441
3542
echo master | git bundle create stdin-bundle.bdl --stdin &&

0 commit comments

Comments
 (0)