mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
CommitView: Add a better reflog entry
This adds an entry in the form of commit: CommitView: Add a better reflog entry to the reflog upon commit, rather than Commit from GitX which isn't very informative
This commit is contained in:
@@ -221,7 +221,14 @@
|
||||
informativeTextWithFormat:@"Please enter a commit message before committing"] runModal];
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *commitSubject = [commitMessage substringToIndex:
|
||||
[commitMessage rangeOfString:@"\n"].location];
|
||||
if (!commitSubject)
|
||||
commitSubject = commitMessage;
|
||||
|
||||
commitSubject = [@"commit: " stringByAppendingString:commitSubject];
|
||||
|
||||
self.busy++;
|
||||
self.status = @"Creating tree..";
|
||||
NSString *tree = [repository outputForCommand:@"write-tree"];
|
||||
@@ -243,7 +250,7 @@
|
||||
if (ret || [commit length] != 40)
|
||||
return [self commitFailedBecause:@"Could not create a commit object"];
|
||||
|
||||
[repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-m", @"Commit from GitX", @"HEAD", commit, nil]
|
||||
[repository outputForArguments:[NSArray arrayWithObjects:@"update-ref", @"-m", commitSubject, @"HEAD", commit, nil]
|
||||
retValue: &ret];
|
||||
if (ret)
|
||||
return [self commitFailedBecause:@"Could not update HEAD"];
|
||||
|
||||
Reference in New Issue
Block a user