summaryrefslogtreecommitdiffstats
path: root/modules/git/commit.go
diff options
context:
space:
mode:
authorRichard Mahn <richmahn@users.noreply.github.com>2019-04-17 10:06:35 -0600
committertechknowlogick <matti@mdranta.net>2019-04-17 12:06:35 -0400
commit2262811e407facea09047e94aa1850c192511587 (patch)
treea478624613dc6cf095784d629f9627b197de15e8 /modules/git/commit.go
parent059195b127848d96a4690257af19d8c97c6d2363 (diff)
downloadgitea-2262811e407facea09047e94aa1850c192511587.tar.gz
gitea-2262811e407facea09047e94aa1850c192511587.zip
Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314)
Diffstat (limited to 'modules/git/commit.go')
-rw-r--r--modules/git/commit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go
index 85c9554bb5..dad67dada6 100644
--- a/modules/git/commit.go
+++ b/modules/git/commit.go
@@ -263,6 +263,11 @@ func (c *Commit) GetFilesChangedSinceCommit(pastCommit string) ([]string, error)
return c.repo.getFilesChanged(pastCommit, c.ID.String())
}
+// FileChangedSinceCommit Returns true if the file given has changed since the the past commit
+func (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, error) {
+ return c.repo.FileChangedBetweenCommits(filename, pastCommit, c.ID.String())
+}
+
// GetSubModules get all the sub modules of current revision git tree
func (c *Commit) GetSubModules() (*ObjectCache, error) {
if c.submoduleCache != nil {