Permalink
Browse files

Merge pull request #29 from nabeshin/fix_stash_datetime

Fixed DateTime property of Stash class.
  • Loading branch information...
2 parents b72fbd2 + 9bb1e46 commit 4cef5fe76e80cfb457abb7d5f9d8c5040affa4c5 @henon committed Nov 24, 2013
Showing with 8 additions and 3 deletions.
  1. +8 −3 GitSharp/Stash.cs
View
@@ -108,9 +108,14 @@ internal static Stash Parse (string line)
i2 += 2;
i = line.IndexOf (' ', i2);
int secs = int.Parse (line.Substring (i2, i - i2));
- DateTime t = new DateTime (1970, 1, 1) + TimeSpan.FromSeconds (secs);
- string st = t.ToString ("yyyy-MM-ddTHH:mm:ss") + line.Substring (i + 1, 3) + ":" + line.Substring (i + 4, 2);
- s.DateTime = DateTimeOffset.Parse (st);
+
+ string stUtcOffset = line.Substring (i + 1, 3) + ":" + line.Substring (i + 4, 2);
+ if (stUtcOffset[0] == '+') stUtcOffset = stUtcOffset.Remove(0, 1);
+ TimeSpan utcOffset = TimeSpan.Parse(stUtcOffset);
+
+ DateTime t = new DateTime (1970, 1, 1) + TimeSpan.FromSeconds (secs) + utcOffset;
+ s.DateTime = new DateTimeOffset(t, utcOffset);
+
s.Comment = line.Substring (i + 7);
}
s.FullLine = line;

2 comments on commit 4cef5fe

@i00
i00 commented on 4cef5fe Mar 3, 2016

Does not seem to be any kind of issue tracker so submitting it here...

The allocating of lines for the commit graph in PlotCommitList does not work correctly...

Sometimes lines are re-used when they shouldn't be.
Kris

@henon
Owner
henon commented on 4cef5fe Mar 3, 2016

why would you post your issue in the comments of a totally unrelated commit? There is "issues" to report issues. But best thing would be to fix it and submit a pull request

Please sign in to comment.