-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crashes when opening Submodules. #209
base: master
Are you sure you want to change the base?
Conversation
…fix crashes in PBGitCommitController. I had these crashes only when opening Submodules, didn't try to find why though.
@@ -219,6 +219,9 @@ - (id) initWithURL: (NSURL*) path | |||
// We don't want the window controller to display anything yet.. | |||
// We'll leave that to the caller of this method. | |||
#ifndef CLI | |||
if (![self workingDirectory]) { // If we couldn't find the working directory, assume it's the place we were opened from. | |||
workingDirectory = [[path absoluteURL] path]; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just copypasted this from line 169 -readFromURL:ofType:error:
Hah, this made them rare, but still possible to crash. PBGitRepository than have fileURL like so there's no "/.git" suffix and "rev-parse --is-inside-work-tree" command returns false. |
Ok, now -workingDirectory can not return nil. |
Would love to see a version with this PR merged |
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 |
Update Screenshots
Subj, [theRepository workingDirectory] was nill &
in the PBGitCommitController's -initWithRepository:superController: