Write commit message to file

Typically, git-commit writes the commit message
to .git/COMMIT_EDITMSG. This writes the commit
message to that file manually to assist in
hooks such as commit-msg and
prepare-commit-msg which expect this file as the
first argument.
This commit is contained in:
Joe Fiorini
2009-05-24 16:43:38 -04:00
committed by Pieter de Bie
parent e9d45261bd
commit 897c80f8a7
+6
View File
@@ -289,6 +289,12 @@
commitSubject = [@"commit: " stringByAppendingString:commitSubject];
NSString *commitMessageFile;
commitMessageFile = [repository.fileURL.path
stringByAppendingPathComponent:@"COMMIT_EDITMSG"];
[commitMessage writeToFile:commitMessageFile atomically:YES encoding:NSUTF8StringEncoding error:nil];
self.busy++;
self.status = @"Creating tree..";
NSString *tree = [repository outputForCommand:@"write-tree"];