Refactor parseSignatureFromCommitLine (#29054) (#29108)

Backport #29054. Fix #28840

This backport is for 1.21 only and it is different from the change in
1.22: this backport still accept the legacy date format to avoid
breaking.
This commit is contained in:
wxiaoguang authored and GitHub committed 2024-02-09 10:26:43 +01:00
1 parent 1aaeec6da7
commit 732d511e04
8 files changed
+104 -149

No files matched your search

+1 -1
View File
@@ -236,7 +236,7 @@ func GetLatestCommitTime(ctx context.Context, repoPath string) (time.Time, error
return time.Time{}, err
}
commitTime := strings.TrimSpace(stdout)
return time.Parse(GitTimeLayout, commitTime)
return time.Parse("Mon Jan _2 15:04:05 2006 -0700", commitTime)
}
// DivergeObject represents commit count diverging commits