libgit2/objective-git — pull request #363 by joshvera (2014-04-22 07:57:53+00:00)
Title: Convert GTIndexEntry paths using -UTF8String instead of -fileSystemRepresentation

This fixes an issue where some filenames with unicode characters weren't added or removed to the index with `-removeFile:error:` and `addFile:error:` when using libgit2 file path strings marshaled through `stringWithFileSystemRepresentation:length:` and `-fileSystemRepresentation`.

We thought the issue might be with `core.precomposeunicode` but I don't think that's the case. With `core.precomposeunicode` enabled or disabled, file path strings instantiated with `-stringWithFileSystemRepresentation:length:` or `-initWithCString:encoding:` are equal to their precomposed representations.

Instead, it looks like the C strings returned by `-fileSystemRepresentation` are always decomposed whether or not the original path string was precomposed. `-UTF8String` doesn't normalize the string so it should be safer to use here.