diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2010-07-29 09:09:54 +0200 |
---|---|---|
committer | Christian Halstrick <christian.halstrick@sap.com> | 2010-07-29 15:12:14 +0200 |
commit | 94207f0a43a44261b8170d3cdba3028059775d9d (patch) | |
tree | a91f7ab5afeacb09a73b9307c8081f831ed41088 | |
parent | 7b8e8df7995400637469d08baab2ee1af5537831 (diff) | |
download | jgit-94207f0a43a44261b8170d3cdba3028059775d9d.tar.gz jgit-94207f0a43a44261b8170d3cdba3028059775d9d.zip |
Make use of Repository.writeMerge...()
The CommitCommand should not use java.io to delete MERGE_HEAD and MERGE_MSG
files since Repository already has utility methods for that.
Change-Id: If66a419349b95510e5b5c2237a91f06c1d5ba0d4
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java index 17b7113470..0dbe51281f 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -42,7 +42,6 @@ */ package org.eclipse.jgit.api; -import java.io.File; import java.io.IOException; import java.text.MessageFormat; import java.util.LinkedList; @@ -174,13 +173,11 @@ public class CommitCommand extends GitCommand<RevCommit> { case NEW: case FAST_FORWARD: { setCallable(false); - File meta = repo.getDirectory(); - if (state == RepositoryState.MERGING_RESOLVED - && meta != null) { + if (state == RepositoryState.MERGING_RESOLVED) { // Commit was successful. Now delete the files // used for merge commits - new File(meta, Constants.MERGE_HEAD).delete(); - new File(meta, Constants.MERGE_MSG).delete(); + repo.writeMergeCommitMsg(null); + repo.writeMergeHeads(null); } return revCommit; } |