diff options
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java | 13 |
1 files changed, 7 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 f12c94b33e..1cf2fe669c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java @@ -171,17 +171,18 @@ public class CommitCommand extends GitCommand<RevCommit> { Result rc = ru.update(); switch (rc) { case NEW: - case FAST_FORWARD: + case FAST_FORWARD: { setCallable(false); - if (state == RepositoryState.MERGING_RESOLVED) { + File meta = repo.getDirectory(); + if (state == RepositoryState.MERGING_RESOLVED + && meta != null) { // Commit was successful. Now delete the files // used for merge commits - new File(repo.getDirectory(), Constants.MERGE_HEAD) - .delete(); - new File(repo.getDirectory(), Constants.MERGE_MSG) - .delete(); + new File(meta, Constants.MERGE_HEAD).delete(); + new File(meta, Constants.MERGE_MSG).delete(); } return revCommit; + } case REJECTED: case LOCK_FAILURE: throw new ConcurrentRefUpdateException( |