aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2018-12-19 11:34:35 +0100
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-02-26 16:18:27 +0900
commit38e5a75ce49abe7068e4612f4159902114ca951f (patch)
tree2e9032214429e4dee011e22376e7615fc9549577
parent4ad53c0cbf9ec33984ad375b682fab91160d410b (diff)
downloadjgit-38e5a75ce49abe7068e4612f4159902114ca951f.tar.gz
jgit-38e5a75ce49abe7068e4612f4159902114ca951f.zip
RebaseCommand: tighten check for --preserve-merges on --continue
With native git, .git/rebase-merge/rewritten exists actually in two different cases: * as a file in git rebase --merge recording OIDs for copying notes * as a directory in git rebase --preserve-merges Add a comment, and check for isDirectory() instead of exists(). Bug: 511487 Change-Id: I6a3317b4234d4f41c41b3004cdc7ea0abf2c6223 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
index 9e83fc73d6..0e3d000d3a 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -180,6 +180,10 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
/**
* The folder containing the hashes of (potentially) rewritten commits when
* --preserve-merges is used.
+ * <p>
+ * Native git rebase --merge uses a <em>file</em> of that name to record
+ * commits to copy notes at the end of the whole rebase.
+ * </p>
*/
private static final String REWRITTEN = "rewritten"; //$NON-NLS-1$
@@ -292,7 +296,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
}
this.upstreamCommit = walk.parseCommit(repo
.resolve(upstreamCommitId));
- preserveMerges = rebaseState.getRewrittenDir().exists();
+ preserveMerges = rebaseState.getRewrittenDir().isDirectory();
break;
case BEGIN:
autoStash();