Skip to content

Commit e1a3f17

Browse files
committed
Merge branch 'lf/bundle-with-tip-wo-message'
"git bundle" did not like a bundle created using a commit without any message as its one of the prerequistes. * lf/bundle-with-tip-wo-message: bundle: Accept prerequisites without commit messages
2 parents 51ff04b + 5446e33 commit e1a3f17

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

bundle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int parse_bundle_header(int fd, struct bundle_header *header,
5757
* followed by SP and subject line.
5858
*/
5959
if (get_sha1_hex(buf.buf, sha1) ||
60-
(40 <= buf.len && !isspace(buf.buf[40])) ||
60+
(buf.len > 40 && !isspace(buf.buf[40])) ||
6161
(!is_prereq && buf.len <= 40)) {
6262
if (report_path)
6363
error(_("unrecognized header: %s%s (%d)"),

t/t5704-bundle.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,14 @@ test_expect_success 'ridiculously long subject in boundary' '
5858
grep "^-[0-9a-f]\\{40\\} " boundary
5959
'
6060

61+
test_expect_success 'prerequisites with an empty commit message' '
62+
: >file1 &&
63+
git add file1 &&
64+
test_tick &&
65+
git commit --allow-empty-message -m "" &&
66+
test_commit file2 &&
67+
git bundle create bundle HEAD^.. &&
68+
git bundle verify bundle
69+
'
70+
6171
test_done

0 commit comments

Comments
 (0)