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, 3 insertions, 2 deletions
diff --git a/src/commit.c b/src/commit.c
index 9449224ef..2714f1acc 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -174,8 +174,6 @@ int git_commit__parse_buffer(git_commit *commit, const void *data, size_t len)
const char *eoln = buffer;
while (eoln < buffer_end && *eoln != '\n')
++eoln;
- if (eoln < buffer_end && *eoln == '\n')
- ++eoln;
if (git__prefixcmp(buffer, "encoding ") == 0) {
buffer += strlen("encoding ");
@@ -184,6 +182,9 @@ int git_commit__parse_buffer(git_commit *commit, const void *data, size_t len)
GITERR_CHECK_ALLOC(commit->message_encoding);
}
+ if (eoln < buffer_end && *eoln == '\n')
+ ++eoln;
+
buffer = eoln;
}