summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-08-07 16:49:45 +0200
committerRobin Rosenberg <robin.rosenberg@dewire.com>2012-08-07 16:49:45 +0200
commit993fcac2d34f113977c1ad7e0f83a2cc0f903f71 (patch)
treef8e79bb05ef0b864cdc30101b52a90d66c9a4696 /org.eclipse.jgit
parent7c1e175de8ca26b572816204c7ac7bb9ce49678f (diff)
downloadjgit-993fcac2d34f113977c1ad7e0f83a2cc0f903f71.tar.gz
jgit-993fcac2d34f113977c1ad7e0f83a2cc0f903f71.zip
Allow JGit to read C Git rebase state
C Git prefixes the time stamp in the author script with a "@" Change-Id: I140b29519acc101da78296eef562368fc6b61135
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java9
1 files changed, 8 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 6f0c3eb0f4..9f8aa7bfb2 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/api/RebaseCommand.java
@@ -439,6 +439,7 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
// representation for date and timezone
sb.append(GIT_AUTHOR_DATE);
sb.append("='");
+ sb.append("@"); // @ for time in seconds since 1970
String externalString = author.toExternalString();
sb
.append(externalString.substring(externalString
@@ -1013,7 +1014,13 @@ public class RebaseCommand extends GitCommand<RebaseResult> {
String time = keyValueMap.get(GIT_AUTHOR_DATE);
// the time is saved as <seconds since 1970> <timezone offset>
- long when = Long.parseLong(time.substring(0, time.indexOf(' '))) * 1000;
+ int timeStart = 0;
+ if (time.startsWith("@"))
+ timeStart = 1;
+ else
+ timeStart = 0;
+ long when = Long
+ .parseLong(time.substring(timeStart, time.indexOf(' '))) * 1000;
String tzOffsetString = time.substring(time.indexOf(' ') + 1);
int multiplier = -1;
if (tzOffsetString.charAt(0) == '+')