diff options
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git.go | 2 | ||||
-rw-r--r-- | pkg/commands/git_test.go | 27 |
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{} |