1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

more centralised handling of refreshing

This commit is contained in:
Jesse Duffield
2020-03-27 19:12:15 +11:00
parent 39315ca1e2
commit 198d237679
32 changed files with 189 additions and 126 deletions

View File

@ -2,7 +2,6 @@ package commands
import (
"regexp"
"strconv"
"strings"
"github.com/jesseduffield/lazygit/pkg/utils"
@ -145,13 +144,7 @@ func (b *BranchListBuilder) obtainReflogBranches() []*Branch {
reflogBranches := make([]*Branch, 0, len(b.ReflogCommits))
for _, commit := range b.ReflogCommits {
if match := re.FindStringSubmatch(commit.Name); len(match) == 3 {
timestamp, err := strconv.Atoi(commit.Date)
if err != nil {
b.Log.Errorf("couldn't parse reflog date: %s", commit.Date)
continue
}
recency := utils.UnixToTimeAgo(timestamp)
recency := utils.UnixToTimeAgo(commit.UnixTimestamp)
for _, branchName := range match[1:] {
if !foundBranchesMap[branchName] {
foundBranchesMap[branchName] = true