[PR #97] [MERGED] Fix time parsing #103

Closed
opened 2026-02-16 10:24:07 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/git/pull/97
Author: @ethantkoenig
Created: 12/9/2017
Status: Merged
Merged: 12/10/2017
Merged by: @lafriks

Base: masterHead: fix/time


📝 Commits (1)

📊 Changes

2 files changed (+7 additions, -2 deletions)

View changed files

📝 repo.go (+1 -1)
📝 signature.go (+6 -1)

📄 Description

Fix time parsing in GetLatestCommitTime, which would fail on days 1-9 of the month (since the date only has one digit, see below output). Also moves the time format to a named constant, since it is used in multiple places.

--- FAIL: TestGetLatestCommitTime (0.00s)
        Error Trace:    repo_test.go:15
	Error:		Received unexpected error:
			parsing time "Sat Dec 9 17:17:57 2017 -0800" as "Mon Jan 02 15:04:05 2006 -0700": cannot parse "9 17:17:57 2017 -0800" as "02"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/git/pull/97 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 12/9/2017 **Status:** ✅ Merged **Merged:** 12/10/2017 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `fix/time` --- ### 📝 Commits (1) - [`b9b2b4e`](https://github.com/go-gitea/git/commit/b9b2b4e64d6e3819fc22120054cd729a6f51acc5) Fix time parsing ### 📊 Changes **2 files changed** (+7 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `repo.go` (+1 -1) 📝 `signature.go` (+6 -1) </details> ### 📄 Description Fix time parsing in `GetLatestCommitTime`, which would fail on days 1-9 of the month (since the date only has one digit, see below output). Also moves the time format to a named constant, since it is used in multiple places. ``` --- FAIL: TestGetLatestCommitTime (0.00s) Error Trace: repo_test.go:15 Error: Received unexpected error: parsing time "Sat Dec 9 17:17:57 2017 -0800" as "Mon Jan 02 15:04:05 2006 -0700": cannot parse "9 17:17:57 2017 -0800" as "02" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 10:24:07 -05:00
yindo closed this issue 2026-02-16 10:24:07 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: go-gitea/git#103