summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorGiorgio Previtera <gprevitera@equalexperts.com>2019-07-14 11:29:36 +0100
committerJesse Duffield <jessedduffield@gmail.com>2019-07-27 11:05:23 +1000
commit827837b0b940d9367cefd03eb0e779711f9489da (patch)
tree23ca7baf49a38d999de356daee273aedd711055e /pkg/commands
parente83ef9858b70972b9c6b2efbbc4f5df7d8a5fe82 (diff)
477 Remove unnecessary variable check
hasInlineMergeConflicts is always true with hasMergeConflicts is true
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go2
-rw-r--r--pkg/commands/git_test.go27
2 files changed, 1 insertions, 28 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index 5aeaa08ee..5e2e7e33c 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -473,7 +473,7 @@ func (c *GitCommand) RebaseMode() (string, error) {
func (c *GitCommand) DiscardAllFileChanges(file *File) error {
// if the file isn't tracked, we assume you want to delete it
quotedFileName := c.OSCommand.Quote(file.Name)
- if file.HasStagedChanges || file.HasMergeConflicts || file.HasInlineMergeConflicts {
+ if file.HasStagedChanges || file.HasMergeConflicts {
if err := c.OSCommand.RunCommand(fmt.Sprintf("git reset -- %s", quotedFileName)); err != nil {
return err
}
diff --git a/pkg/commands/git_test.go b/pkg/commands/git_test.go
index 5a043c4c7..51188f14d 100644
--- a/pkg/commands/git_test.go
+++ b/pkg/commands/git_test.go
@@ -1348,33 +1348,6 @@ func TestGitCommandDiscardAllFileChanges(t *testing.T) {
},
},
{
- "Reset and checkout inline merge conflicts",
- func() (func(string, ...string) *exec.Cmd, *[][]string) {
- cmdsCalled := [][]string{}
- return func(cmd string, args ...string) *exec.Cmd {
- cmdsCalled = append(cmdsCalled, args)
-
- return exec.Command("echo")
- }, &cmdsCalled
- },
- func(cmdsCalled *[][]string, err error) {
- assert.NoError(t, err)
- assert.Len(t, *cmdsCalled, 2)
- assert.EqualValues(t, *cmdsCalled, [][]string{
- {"reset", "--", "test"},
- {"checkout", "--", "test"},
- })
- },
- &File{
- Name: "test",
- Tracked: true,
- HasInlineMergeConflicts: true,
- },
- func(string) error {
- return nil
- },
- },
- {
"Reset and remove",
func() (func(string, ...string) *exec.Cmd, *[][]string) {
cmdsCalled := [][]string{}