mirror of
https://github.com/git/git.git
synced 2026-01-25 10:03:24 +00:00
Merge pull request #797 from glhez/master
`git bundle create <bundle>` leaks handle the revlist is empty.
This commit is contained in:
7
bundle.c
7
bundle.c
@@ -447,10 +447,11 @@ int create_bundle(struct bundle_header *header, const char *path,
|
||||
object_array_remove_duplicates(&revs.pending);
|
||||
|
||||
ref_count = write_bundle_refs(bundle_fd, &revs);
|
||||
if (!ref_count)
|
||||
die(_("Refusing to create empty bundle."));
|
||||
else if (ref_count < 0)
|
||||
if (ref_count <= 0) {
|
||||
if (!ref_count)
|
||||
error(_("Refusing to create empty bundle."));
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* write pack */
|
||||
if (write_pack_data(bundle_fd, &revs)) {
|
||||
|
||||
15
t/tgfw790-git-bundle.sh
Normal file
15
t/tgfw790-git-bundle.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
test_description='
|
||||
test git-bundle under git for Windows
|
||||
|
||||
When we select an empty set of commit (like git bundle create foobar.bundle master..master),
|
||||
we should not have problem with the foobar.bundle.lock being locked (especially on Windows).
|
||||
'
|
||||
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_failure 'try to create a bundle with empty ref count' '
|
||||
git bundle create foobar.bundle master..master
|
||||
'
|
||||
|
||||
test_done
|
||||
Reference in New Issue
Block a user