summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorChristian Muehlhaeuser <muesli@gmail.com>2019-07-19 04:00:02 +0200
committerJesse Duffield <jessedduffield@gmail.com>2019-07-27 10:52:06 +1000
commit975a5315b036b84e0d8befd7ca5e7dbc062caf84 (patch)
tree3adc6592adb8fc24b14444eab11e3a5a2cb50a20 /pkg/commands
parent8f734b11e3e57e3338841305bba074846c6b5a58 (diff)
Simplified code a bit
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go
index fa1a73157..3bda46ee3 100644
--- a/pkg/commands/git.go
+++ b/pkg/commands/git.go
@@ -906,10 +906,8 @@ func (c *GitCommand) DiscardOldFileChanges(commits []*Commit, commitIndex int, f
if err := c.StageFile(fileName); err != nil {
return err
}
- } else {
- if err := c.CheckoutFile("HEAD^", fileName); err != nil {
- return err
- }
+ } else if err := c.CheckoutFile("HEAD^", fileName); err != nil {
+ return err
}
// amend the commit