From: Lars Schneider <larsxschneider@xxxxxxxxx> Hi Junio, I overlooked a typo pointed out in Simon's review. Here is a new patch for squashing. Sorry for the trouble! @Eric: Thanks for spotting this! Cheers, Lars convert.c | 8 ++++++-- t/t0028-working-tree-encoding.sh | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/convert.c b/convert.c index 13fad490ce..dce2f6e201 100644 --- a/convert.c +++ b/convert.c @@ -1165,8 +1165,12 @@ static struct encoding *git_path_check_encoding(struct attr_check_item *check) if (!strcasecmp(value, default_encoding)) return NULL; - enc = xcalloc(1, sizeof(struct convert_driver)); - enc->name = xstrdup_toupper(value); /* aways use upper case names! */ + enc = xcalloc(1, sizeof(*enc)); + /* + * Ensure encoding names are always upper case (e.g. UTF-8) to + * simplify subsequent string comparisons. + */ + enc->name = xstrdup_toupper(value); *encoding_tail = enc; encoding_tail = &(enc->next); diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh index 0f36d4990a..a6da61280d 100755 --- a/t/t0028-working-tree-encoding.sh +++ b/t/t0028-working-tree-encoding.sh @@ -22,6 +22,8 @@ test_expect_success 'setup test repo' ' test_expect_success 'ensure UTF-8 is stored in Git' ' git cat-file -p :test.utf16 >test.utf16.git && test_cmp_bin test.utf8.raw test.utf16.git && + + # cleanup rm test.utf8.raw test.utf16.git ' base-commit: 21f4dac5aba07a6109285c57a0478bf502e09009 -- 2.16.0