@@ -349,7 +349,6 @@ void test_commit_parse__details0(void) {
349
349
cl_assert_equal_s ("Scott Chacon" , committer -> name );
350
350
cl_assert_equal_s ("schacon@gmail.com" , committer -> email );
351
351
cl_assert (message != NULL );
352
- cl_assert (strchr (message , '\n' ) != NULL );
353
352
cl_assert (commit_time > 0 );
354
353
cl_assert (parents <= 2 );
355
354
for (p = 0 ;p < parents ;p ++ ) {
@@ -382,9 +381,25 @@ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
382
381
\n\
383
382
This commit has a few LF at the start of the commit message" ;
384
383
const char * message =
385
- "\n\
384
+ "This commit has a few LF at the start of the commit message" ;
385
+
386
+ cl_git_pass (parse_commit (& commit , buffer ));
387
+ cl_assert_equal_s (message , git_commit_message (commit ));
388
+ git_commit__free (commit );
389
+ }
390
+
391
+ void test_commit_parse__only_lf (void )
392
+ {
393
+ git_commit * commit ;
394
+ const char * buffer =
395
+ "tree 1810dff58d8a660512d4832e740f692884338ccd\n\
396
+ parent e90810b8df3e80c413d903f631643c716887138d\n\
397
+ author Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
398
+ committer Vicent Marti <tanoku@gmail.com> 1273848544 +0200\n\
386
399
\n\
387
- This commit has a few LF at the start of the commit message" ;
400
+ \n\
401
+ \n" ;
402
+ const char * message = "" ;
388
403
389
404
cl_git_pass (parse_commit (& commit , buffer ));
390
405
cl_assert_equal_s (message , git_commit_message (commit ));
0 commit comments