Skip to content

Commit 17d2d0d

Browse files
newrengitster
authored andcommitted
fast-export: differentiate between explicitly utf-8 and implicitly utf-8
The find_encoding() function returned the encoding used by a commit message, returning a default of git_commit_encoding (usually utf-8). Although the current code does not differentiate between a commit which explicitly requested utf-8 and one where we just assume utf-8 because no encoding is set, it will become important when we try to preserve the encoding header. Since is_encoding_utf8() returns true when passed NULL, we can just return NULL from find_encoding() instead of returning git_commit_encoding. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1c49391 commit 17d2d0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/fast-export.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ static const char *find_encoding(const char *begin, const char *end)
453453
bol = memmem(begin, end ? end - begin : strlen(begin),
454454
needle, strlen(needle));
455455
if (!bol)
456-
return git_commit_encoding;
456+
return NULL;
457457
bol += strlen(needle);
458458
eol = strchrnul(bol, '\n');
459459
*eol = '\0';

0 commit comments

Comments
 (0)