From 897c80f8a71a5ef557c4adf675fd9e4d509f2e10 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Sun, 24 May 2009 16:43:38 -0400 Subject: [PATCH] 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. --- PBGitCommitController.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/PBGitCommitController.m b/PBGitCommitController.m index fcf1f69..15d889d 100644 --- a/PBGitCommitController.m +++ b/PBGitCommitController.m @@ -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"];