Browse Source

Print the timestamp of the last commit

Vadim Markovtsev 7 years ago
parent
commit
d7be9b0e6e
2 changed files with 4 additions and 2 deletions
  1. 3 1
      cmd/hercules/main.go
  2. 1 1
      file_test.go

+ 3 - 1
cmd/hercules/main.go

@@ -143,7 +143,9 @@ func main() {
 	width := len(strconv.FormatInt(maxnum, 10))
 	last := len(statuses[len(statuses)-1])
 	// print the start date, granularity, sampling
-	fmt.Println(commits[0].Author.When.Unix(), granularity, sampling)
+	fmt.Println(commits[0].Author.When.Unix(),
+		commits[len(commits)-1].Author.When.Unix(),
+		granularity, sampling)
 	// print the resulting triangle matrix
 	for _, status := range statuses {
 		for i := 0; i < last; i++ {

+ 1 - 1
file_test.go

@@ -355,7 +355,7 @@ func TestBug5(t *testing.T) {
 	dump := file.Dump()
 	assert.Equal(t, "0 28\n2 24\n5 28\n8 -1\n", dump)
 
-	keys = []int{0, 1, 16, 18,}
+	keys = []int{0, 1, 16, 18}
 	vals = []int{305, 0, 157, -1}
 	file = NewFileFromTree(keys, vals, status)
 	file.Update(310, 0, 0, 2)