summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-01-29 18:51:26 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-01-29 19:07:47 +1100
commit44edb49a6e9c24128a14517f60d1a75f70a539f8 (patch)
tree91f6a5f8860261be3de8055c93bf8f9632404209
parent1a6d2690634b255f15fe0bdc424829666e6fe87a (diff)
handle files that were deleted downstream but modified upstream
-rw-r--r--pkg/commands/git.go8
1 files 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,