Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
builtin-commit.c: fix logic to omit empty line before existing footers
[gitweb.git]
/
builtin-commit.c
diff --git
a/builtin-commit.c
b/builtin-commit.c
index c395cbf14f7e99880f39a63939dc174ba494004c..cfa6b06e92924484376d853eef7171d163fe7fe1 100644
(file)
--- a/
builtin-commit.c
+++ b/
builtin-commit.c
@@
-530,7
+530,7
@@
static int prepare_to_commit(const char *index_file, const char *prefix,
for (i = sb.len - 1; i > 0 && sb.buf[i - 1] != '\n'; i--)
; /* do nothing */
if (prefixcmp(sb.buf + i, sob.buf)) {
- if (!ends_rfc2822_footer(&sb))
+ if (!
i || !
ends_rfc2822_footer(&sb))
strbuf_addch(&sb, '\n');
strbuf_addbuf(&sb, &sob);
}