From 44edb49a6e9c24128a14517f60d1a75f70a539f8 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Wed, 29 Jan 2020 18:51:26 +1100 Subject: [PATCH] handle files that were deleted downstream but modified upstream --- pkg/commands/git.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/commands/git.go b/pkg/commands/git.go index b1bb9ee6e..4bb574f95 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -191,10 +191,10 @@ func (c *GitCommand) GetStatusFiles() []*File { stagedChange := change[0:1] unstagedChange := statusString[1:2] filename := c.OSCommand.Unquote(statusString[3:]) - _, untracked := map[string]bool{"??": true, "A ": true, "AM": true}[change] - _, hasNoStagedChanges := map[string]bool{" ": true, "U": true, "?": true}[stagedChange] - hasMergeConflicts := change == "UU" || change == "AA" || change == "DU" - hasInlineMergeConflicts := change == "UU" || change == "AA" + untracked := utils.IncludesString([]string{"??", "A ", "AM"}, change) + hasNoStagedChanges := utils.IncludesString([]string{" ", "U", "?"}, stagedChange) + hasMergeConflicts := utils.IncludesString([]string{"DD", "AA", "UU", "AU", "UA", "UD", "DU"}, change) + hasInlineMergeConflicts := utils.IncludesString([]string{"UU", "AA"}, change) file := &File{ Name: filename,