summaryrefslogtreecommitdiffstats
path: root/pkg/commands/files.go
diff options
context:
space:
mode:
authorblack_desk <clx814727823@gmail.com>2021-08-13 14:02:11 +0800
committerblack_desk <clx814727823@gmail.com>2021-08-13 14:02:11 +0800
commitd51b065f2a9cc6b6b0899b0bac3a1e80e04410ad (patch)
tree8111bff347c0aafc9a66c485c460d0efb28c6fff /pkg/commands/files.go
parenta3a14e9ff47683c5d4e926ec5630935c8587c11c (diff)
fix empty patch panel when spaces in filename
Diffstat (limited to 'pkg/commands/files.go')
-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 f4588aac5..157fa843b 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, fileName)
}
// CheckoutFile checks out the file for the given commit