aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2018-12-19 11:07:43 +0100
committerDavid Pursehouse <david.pursehouse@gmail.com>2019-02-26 16:18:27 +0900
commitb4c212309b27c01dcf1a859774f6a0dc0a2338a5 (patch)
treeef3d69f7ffa3dfea53993edb3b9d5119af0af299 /org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
parenta64fa0bd7f0f958ccd87b0cd5e7c1bd39500c636 (diff)
downloadjgit-b4c212309b27c01dcf1a859774f6a0dc0a2338a5.tar.gz
jgit-b4c212309b27c01dcf1a859774f6a0dc0a2338a5.zip
RebaseCommand: use orig-head in addition to head
Since 2011-02-10 (i.e., git 1.7.6)[1] native git uses "orig-head" for REBASE_HEAD. JGit was still using "head". Currently native git has a legacy fall-back for reading this, but for how long? Let's write to both. Note that JGit never reads this file. [1] https://github.com/git/git/commit/84df4560 Bug: 511487 Change-Id: Id3742bf9bbc0001d850e801b26cc8880e646abfc Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java')
-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 416a6c2dfc..4d3f2d9831 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -162,7 +162,10 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
private static final String PATCH = "patch"; //$NON-NLS-1$
- private static final String REBASE_HEAD = "head"; //$NON-NLS-1$
+ private static final String REBASE_HEAD = "orig-head"; //$NON-NLS-1$
+
+ /** Pre git 1.7.6 file name for {@link #REBASE_HEAD}. */
+ private static final String REBASE_HEAD_LEGACY = "head"; //$NON-NLS-1$
private static final String AMEND = "amend"; //$NON-NLS-1$
@@ -1120,6 +1123,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
repo.writeOrigHead(headId);
rebaseState.createFile(REBASE_HEAD, headId.name());
+ rebaseState.createFile(REBASE_HEAD_LEGACY, headId.name());
rebaseState.createFile(HEAD_NAME, headName);
rebaseState.createFile(ONTO, upstreamCommit.name());
rebaseState.createFile(ONTO_NAME, upstreamCommitName);