@@ -14,7 +14,7 @@ import (
1414type GitOperator interface {
1515 Clone (repoUrl string , directory string , writer * bytes.Buffer ) (err error )
1616 Poll (repo string , branch string , directory string , writer * bytes.Buffer ) (changes bool , err error )
17- Hash (repo string ) (hash string , err error )
17+ Hash (repo string , branch string ) (hash string , err error )
1818}
1919
2020// GitImplementer implements the GitOperator interface.
@@ -54,15 +54,15 @@ func (g *GitImplementer) Poll(repo string, branch string, directory string, writ
5454 }
5555
5656 // Get hash from local repo.
57- localHash , err := g .Hash (directory )
57+ localHash , err := g .Hash (directory , branch )
5858 if err != nil {
5959 fmt .Fprintf (writer , "localGitHash error" )
6060
6161 return changes , err
6262 }
6363
6464 // Get Hash from remote repo
65- remoteHash , err := g .Hash (repo )
65+ remoteHash , err := g .Hash (repo , branch )
6666 if err != nil {
6767 fmt .Fprintf (writer , "remoteGitHash error" )
6868
@@ -79,11 +79,7 @@ func (g *GitImplementer) Poll(repo string, branch string, directory string, writ
7979}
8080
8181// Hash retrieves the hash of the given repository.
82- func (g * GitImplementer ) Hash (repo string ) (hash string , err error ) {
83- //cdk8sAppProxy := &addonsv1alpha1.Cdk8sAppProxy{}
84- //branch := cdk8sAppProxy.Spec.GitRepository.Reference
85- branch := "main"
86-
82+ func (g * GitImplementer ) Hash (repo string , branch string ) (hash string , err error ) {
8783 switch {
8884 case isUrl (repo ):
8985 remoterepo := git .NewRemote (nil , & config.RemoteConfig {
0 commit comments