diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-08-23 22:35:19 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 21:32:48 +1000 |
commit | c3d7de1c183ddf2bea39647114403d16825fdd9d (patch) | |
tree | 57a4ead9c3cdc0ce3a54cc697bf847953b29ff11 /pkg/commands/files.go | |
parent | 711bd5a670f5321495700a55503e4d4a9742f7ae (diff) |
Change not to use cat command
Diffstat (limited to 'pkg/commands/files.go')
-rw-r--r-- | pkg/commands/files.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/commands/files.go b/pkg/commands/files.go index ac508941b..c66ffc5cf 100644 --- a/pkg/commands/files.go +++ b/pkg/commands/files.go @@ -2,6 +2,7 @@ package commands import ( "fmt" + "io/ioutil" "os" "path/filepath" "strconv" @@ -15,7 +16,11 @@ import ( // CatFile obtains the content of a file func (c *GitCommand) CatFile(fileName string) (string, error) { - return c.OSCommand.CatFile(fileName) + buf, err := ioutil.ReadFile(fileName) + if err != nil { + return "", nil + } + return string(buf), nil } func (c *GitCommand) OpenMergeToolCmd() string { |