String[] lines = convertedAuthor.split("\n");
assertEquals("GIT_AUTHOR_NAME='Author name'", lines[0]);
assertEquals("GIT_AUTHOR_EMAIL='a.mail@some.com'", lines[1]);
- assertEquals("GIT_AUTHOR_DATE='123456789 -0100'", lines[2]);
+ assertEquals("GIT_AUTHOR_DATE='@123456789 -0100'", lines[2]);
PersonIdent parsedIdent = git.rebase().parseAuthor(
convertedAuthor.getBytes("UTF-8"));
lines = convertedAuthor.split("\n");
assertEquals("GIT_AUTHOR_NAME='Author name'", lines[0]);
assertEquals("GIT_AUTHOR_EMAIL='a.mail@some.com'", lines[1]);
- assertEquals("GIT_AUTHOR_DATE='123456789 +0930'", lines[2]);
+ assertEquals("GIT_AUTHOR_DATE='@123456789 +0930'", lines[2]);
parsedIdent = git.rebase().parseAuthor(
convertedAuthor.getBytes("UTF-8"));
// 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
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) == '+')