aboutsummaryrefslogtreecommitdiff
path: root/builtin-commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-06 23:17:47 -0800
committerJunio C Hamano <gitster@pobox.com>2009-11-06 23:17:47 -0800
commit6e31f3dbb59c70cae04be3a1fc620e16d247e7d7 (patch)
tree0ae5ce18e7f69766253c8fb174506cf644f9cee6 /builtin-commit.c
parentef0555712c9821cc163508777f20b934bf146971 (diff)
parente5138436ddd4b5f75c1e910f6b844e4fcf91343d (diff)
downloadgit-6e31f3dbb59c70cae04be3a1fc620e16d247e7d7.tar.gz
git-6e31f3dbb59c70cae04be3a1fc620e16d247e7d7.tar.xz
Merge branch 'jc/commit-s-subject-is-not-a-footer'
* jc/commit-s-subject-is-not-a-footer: builtin-commit.c: fix logic to omit empty line before existing footers
Diffstat (limited to 'builtin-commit.c')
-rw-r--r--builtin-commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-commit.c b/builtin-commit.c
index beddf01dd..d525b894e 100644
--- 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);
}