gitx
gitx copied to clipboard
Fix crashes when opening Submodules.
Subj, [theRepository workingDirectory] was nill &
index = [[PBGitIndex alloc] initWithRepository:theRepository workingDirectory:[NSURL fileURLWithPath:[theRepository workingDirectory]]];
in the PBGitCommitController's -initWithRepository:superController:
Hah, this made them rare, but still possible to crash. I've found that i have crash, when opened a submodule.
PBGitRepository than have fileURL like file://localhost/PATH_TO_REPO/.git/modules/SUBMODULE_FOLDER/PATH/
so there's no "/.git" suffix and "rev-parse --is-inside-work-tree" command returns false.
Ok, now -workingDirectory can not return nil. Only if self.fileURL is nil.
Would love to see a version with this PR merged :shipit:
If current master branch is unstable, here's this PR applied to 0.8.4 : https://github.com/psineur/gitx/tree/psineur
Thanks psineur, the patch resolved a crash i was having as well
this resolved the submodule crash for me as well, thanks @psineur