gitx icon indicating copy to clipboard operation
gitx copied to clipboard

Fix crashes when opening Submodules.

Open psineur opened this issue 12 years ago • 6 comments

Subj, [theRepository workingDirectory] was nill &

index = [[PBGitIndex alloc] initWithRepository:theRepository workingDirectory:[NSURL fileURLWithPath:[theRepository workingDirectory]]];

in the PBGitCommitController's -initWithRepository:superController:

psineur avatar Sep 30 '12 18:09 psineur

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.

psineur avatar Sep 30 '12 18:09 psineur

Ok, now -workingDirectory can not return nil. Only if self.fileURL is nil.

psineur avatar Sep 30 '12 19:09 psineur

Would love to see a version with this PR merged :shipit:

stigi avatar Oct 08 '12 15:10 stigi

If current master branch is unstable, here's this PR applied to 0.8.4 : https://github.com/psineur/gitx/tree/psineur

psineur avatar Oct 09 '12 01:10 psineur

Thanks psineur, the patch resolved a crash i was having as well

dannybabiy avatar Nov 04 '12 15:11 dannybabiy

this resolved the submodule crash for me as well, thanks @psineur

jordanandree avatar Nov 19 '12 15:11 jordanandree