diff options
Diffstat (limited to 'pkg/vcs/git.go')
| -rw-r--r-- | pkg/vcs/git.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go index 163f3e497..22a665b37 100644 --- a/pkg/vcs/git.go +++ b/pkg/vcs/git.go @@ -197,6 +197,11 @@ func (git *git) initRepo(reason error) error { return nil } +func (git *git) Contains(commit string) (bool, error) { + _, err := git.git("merge-base", "--is-ancestor", commit, "HEAD") + return err == nil, nil +} + func (git *git) HeadCommit() (*Commit, error) { return git.getCommit("HEAD") } |
