summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-08-13 21:39:38 +0900
committerRyooooooga <eial5q265e5@gmail.com>2021-08-13 21:39:38 +0900
commit488c43aaa201822e3fc824b79d3a3026e3ab865c (patch)
tree3199c9ff2630d13cb6719ed74caf8e22532b8d56 /pkg/commands
parenta2ee52142c2fe28b10d8ff5985dfd7d973a25a83 (diff)
fix crash when double quotes in filename #1433
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/files.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/commands/files.go b/pkg/commands/files.go
index 51523ea5f..99e9bcf5c 100644
--- a/pkg/commands/files.go
+++ b/pkg/commands/files.go
@@ -250,7 +250,7 @@ func (c *GitCommand) ShowFileDiffCmdStr(from string, to string, reverse bool, fi
reverseFlag = " -R "
}
- return fmt.Sprintf(`git diff --submodule --no-ext-diff --no-renames --color=%s %s %s %s -- "%s"`, colorArg, from, to, reverseFlag, fileName)
+ return fmt.Sprintf("git diff --submodule --no-ext-diff --no-renames --color=%s %s %s %s -- %s", colorArg, from, to, reverseFlag, c.OSCommand.Quote(fileName))
}
// CheckoutFile checks out the file for the given commit