Skip to content

Commit

Permalink
git: ActionChanges - style for deleted files
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 14, 2022
1 parent 1e979a6 commit 960475c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/actions/tools/git/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func ActionChanges(opts ChangeOpts) carapace.Action {
if relativePath, err := filepath.Rel(c.Dir, root+"/"+path); err != nil {
return carapace.ActionMessage(err.Error())
} else {
untracked = append(untracked, relativePath, line[:2], style.ForPath(relativePath))
if status := line[:2]; strings.Contains(status, "D") { // deleted
untracked = append(untracked, relativePath, status, style.ForPathExt(relativePath))
} else {
untracked = append(untracked, relativePath, status, style.ForPath(relativePath))
}
}
}
}
Expand Down

0 comments on commit 960475c

Please sign in to comment.