Xcode fails to show git history of projects containing umlauts (regression)

Originator:kastansn
Number:rdar://26861162 Date Originated:2016-06-17
Status:Open Resolved:
Product:Developer Tools Product Version:7.3.1
Classification:UI/Usability Reproducible:Always
 
Summary:
Xcode cannot handle git repositories anymore which contain files in paths that contain an umlaut, for example "Dämo/main.m". This is a regression as it used to work flawlessly before (probably) Xcode version 7.3.x
As soon as Xcode accesses such a repository, it fails with an error in libgit's git_tree_entry_bypath() method. When the offending directory name is changed to a name not containing any umlauts, Xcode has no problems.
This bug is present in the latest official Xcode build (7.3.1) and still present in the Xcode 8 DP. I'm still investigating but it seems that it has been introduced with Xcode 7.3.x
Unfortunately, it greatly limits the workflow as it prevents from using Xcode's nice graphical version comparison view.

Steps to Reproduce:
1. Open the attached demo project (It won't compile and is stripped down to a bare minimum in order to make it easy to show the problem).
2. Examine that its main.m file is marked with "M" for "modified"
3. Choose "Source Control -> Commit …" from the menu
5. Note that you can select UserInterfaceState.xcuserstate without any problems because its file path doesn't contain any umlauts.
5. Now select main.m in order to examine the modified content in comparison to the last commit.


Expected Results:
The split view should show the local file's content on the left pane and the contents of the last commit within the git repository on the right pane.

Actual Results:
Xcode cannot access the git repository and shows an alert: "The source control operation failed because no repository could be found. Make sure a valid repository exists at the specified location and try again."

And Console.app loggs the following:

com.apple.dt.Xcode.sourcecontrol.Git[14914]: #DVTSourceControl Notice: Error with libgit operation (git_tree_entry_bypath(&treeEntry, tree, [relativePath.gitNormalizedString cStringUsingEncoding:NSUTF8StringEncoding]))
Method: -[DVTSourceControlGitPlugInPrimary _libgit_exportFile:inWorkingCopy:fromRevisionLocation:toDirectory:completionBlock:]

Xcode[14857]: #DVTSourceControl Error: -200 The source control operation failed because no repository could be found.
Underlying Error: the path 'Dämo' does not exist in the given tree (-3)
Method: __101-[DVTSourceControlManager exportFile:inWorkingCopy:fromRevisionLocation:toDirectory:completionBlock:]_block_invoke_2

Version:
Xcode Version 7.3.1 (7D1014)
Xcode Version 8.0 beta (8S128d)
OS X 10.11.5 (15F34)
macOS 10.12. DP1

Notes:
Git itself has no problem with accessing said repositories containing an umlaut - it is clearly a bug in Xcode, probably related to or identical to rdar://25650762

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!