diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-27 19:12:15 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-03-28 11:59:45 +1100 |
commit | 198d237679bcc19655138f76a11770c3ef91ec4f (patch) | |
tree | ecc09e91f96baeaf75d437f5fbd00e007d4c6472 /pkg/commands/git.go | |
parent | 39315ca1e2f526911ea35d9848b0427093e4080a (diff) |
more centralised handling of refreshing
Diffstat (limited to 'pkg/commands/git.go')
-rw-r--r-- | pkg/commands/git.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 42b075915..803cfe2d4 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -484,11 +484,7 @@ func (c *GitCommand) GitStatus() (string, error) { // IsInMergeState states whether we are still mid-merge func (c *GitCommand) IsInMergeState() (bool, error) { - output, err := c.OSCommand.RunCommandWithOutput("git status --untracked-files=all") - if err != nil { - return false, err - } - return strings.Contains(output, "conclude merge") || strings.Contains(output, "unmerged paths"), nil + return c.OSCommand.FileExists(fmt.Sprintf("%s/MERGE_HEAD", c.DotGitDir)) } // RebaseMode returns "" for non-rebase mode, "normal" for normal rebase @@ -1133,14 +1129,16 @@ func (c *GitCommand) GetNewReflogCommits(lastReflogCommit *Commit) ([]*Commit, e return false, nil } + unixTimestamp, _ := strconv.Atoi(match[2]) + commit := &Commit{ - Sha: match[1], - Name: match[3], - Date: match[2], - Status: "reflog", + Sha: match[1], + Name: match[3], + UnixTimestamp: int64(unixTimestamp), + Status: "reflog", } - if lastReflogCommit != nil && commit.Sha == lastReflogCommit.Sha && commit.Date == lastReflogCommit.Date { + if lastReflogCommit != nil && commit.Sha == lastReflogCommit.Sha && commit.UnixTimestamp == lastReflogCommit.UnixTimestamp { // after this point we already have these reflogs loaded so we'll simply return the new ones return true, nil } |