Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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.java15
1 files changed, 13 insertions, 2 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 eac6fe6a40..ae6d62963e 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/CommitCommand.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010, Christian Halstrick <christian.halstrick@sap.com>
+ * Copyright (C) 2010-2012, Christian Halstrick <christian.halstrick@sap.com>
* and other copyright owners as documented in the project's IP log.
*
* This program and the accompanying materials are made available
@@ -488,9 +488,20 @@ public class CommitCommand extends GitCommand<RevCommit> {
Constants.MERGE_MSG, e), e);
}
}
+ } else if (state == RepositoryState.SAFE && message == null) {
+ try {
+ message = repo.readSquashCommitMsg();
+ if (message != null)
+ repo.writeSquashCommitMsg(null /* delete */);
+ } catch (IOException e) {
+ throw new JGitInternalException(MessageFormat.format(
+ JGitText.get().exceptionOccurredDuringReadingOfGIT_DIR,
+ Constants.MERGE_MSG, e), e);
+ }
+
}
if (message == null)
- // as long as we don't suppport -C option we have to have
+ // as long as we don't support -C option we have to have
// an explicit message
throw new NoMessageException(JGitText.get().commitMessageNotSpecified);
}

Back to the top