Skip to content

Commit a057a1a

Browse files
committed
fixup! bundle: refuse to create empty bundle
This reverts the patch we carried for a long time, as it did not survive contact with the Git mailing list. In preparation for applying Jeff King's better version, let's revert our version. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 2d3b493 commit a057a1a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

bundle.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,11 +457,10 @@ int create_bundle(struct bundle_header *header, const char *path,
457457
object_array_remove_duplicates(&revs.pending);
458458

459459
ref_count = write_bundle_refs(bundle_fd, &revs);
460-
if (ref_count <= 0) {
461-
if (!ref_count)
462-
error(_("Refusing to create empty bundle."));
460+
if (!ref_count)
461+
die(_("Refusing to create empty bundle."));
462+
else if (ref_count < 0)
463463
goto err;
464-
}
465464

466465
/* write pack */
467466
if (write_pack_data(bundle_fd, &revs)) {

t/t5607-clone-bundle.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,4 @@ test_expect_success 'prerequisites with an empty commit message' '
7171
git bundle verify bundle
7272
'
7373

74-
test_expect_success 'try to create a bundle with empty ref count' '
75-
test_expect_code 1 git bundle create foobar.bundle master..master
76-
'
77-
7874
test_done

0 commit comments

Comments
 (0)