summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/commit.c b/src/commit.c
index f0e304a84..e437cffe6 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -311,7 +311,10 @@ const char *git_commit_summary(git_commit *commit)
git_buf_putc(&summary, *msg);
}
- commit->summary = git_buf_detach(&summary);
+ if (summary.asize == 0)
+ commit->summary = git__strdup("");
+ else
+ commit->summary = git_buf_detach(&summary);
}
return commit->summary;