diff options
Diffstat (limited to 'modules/git/commit.go')
-rw-r--r-- | modules/git/commit.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go index 83e03c2795..eb442f988d 100644 --- a/modules/git/commit.go +++ b/modules/git/commit.go @@ -355,8 +355,11 @@ func (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, erro // HasFile returns true if the file given exists on this commit // This does only mean it's there - it does not mean the file was changed during the commit. func (c *Commit) HasFile(filename string) (bool, error) { - result, err := c.repo.LsFiles(filename) - return result[0] == filename, err + _, err := c.GetBlobByPath(filename) + if err != nil { + return false, err + } + return true, nil } // GetSubModules get all the sub modules of current revision git tree |