aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/object.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2018-10-15 12:21:23 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2018-10-15 12:21:23 +0200
commit7a77bde9448c15251cdcca14db20b7bf5c798692 (patch)
tree4fa875f1fa57b01dcdfdb17d1b3ba2d0519bd493 /plumbing/object/object.go
parent0b7d3fe0a47bd7da9c42ba34b9098441120bda02 (diff)
parent345ffd95a2cd1413d7f48280e21a035febbe4e10 (diff)
downloadgo-git-7a77bde9448c15251cdcca14db20b7bf5c798692.tar.gz
Merge branch 'master' of github.com:src-d/go-git into annotated
Diffstat (limited to 'plumbing/object/object.go')
-rw-r--r--plumbing/object/object.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/plumbing/object/object.go b/plumbing/object/object.go
index 4b59aba..e960e50 100644
--- a/plumbing/object/object.go
+++ b/plumbing/object/object.go
@@ -152,7 +152,11 @@ func (s *Signature) decodeTimeAndTimeZone(b []byte) {
}
func (s *Signature) encodeTimeAndTimeZone(w io.Writer) error {
- _, err := fmt.Fprintf(w, "%d %s", s.When.Unix(), s.When.Format("-0700"))
+ u := s.When.Unix()
+ if u < 0 {
+ u = 0
+ }
+ _, err := fmt.Fprintf(w, "%d %s", u, s.When.Format("-0700"))
return err
}