diff options
-rw-r--r-- | pkg/commands/git.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/commands/git.go b/pkg/commands/git.go index 0e4fa2aec..784dad087 100644 --- a/pkg/commands/git.go +++ b/pkg/commands/git.go @@ -509,7 +509,9 @@ func (c *GitCommand) CatFile(fileName string) (string, error) { // StageFile stages a file func (c *GitCommand) StageFile(fileName string) error { - return c.OSCommand.RunCommand("git add %s", c.OSCommand.Quote(fileName)) + // renamed files look like "file1 -> file2" + fileNames := strings.Split(fileName, " -> ") + return c.OSCommand.RunCommand("git add %s", c.OSCommand.Quote(fileNames[len(fileNames)-1])) } // StageAll stages all files |