Skip to content

Commit 07e5e17

Browse files
code review comments incorporated
1 parent 5c16e8d commit 07e5e17

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/RepoManages.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func (impl RepoManagerImpl) checkoutMaterial(gitCtx git.GitContext, material *sq
354354
gitCtx = gitCtx.WithCredentials(userName, password).
355355
WithCloningMode(impl.configuration.CloningMode)
356356

357-
checkoutPath, _, _, err := impl.repositoryManager.GetLocationForMaterial(material, gitCtx.CloningMode)
357+
checkoutPath, _, _, err := impl.repositoryManager.GetCheckoutLocationFromGitUrl(material, gitCtx.CloningMode)
358358
if err != nil {
359359
return material, err
360360
}

pkg/git/RepositoryManager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type RepositoryManager interface {
4343
Add(gitCtx GitContext, gitProviderId int, location, url string, authMode sql.AuthMode, sshPrivateKeyContent string) error
4444
GetSshPrivateKeyPath(gitCtx GitContext, gitProviderId int, location, url string, authMode sql.AuthMode, sshPrivateKeyContent string) (string, error)
4545
FetchRepo(gitCtx GitContext, location string) error
46-
GetLocationForMaterial(material *sql.GitMaterial, cloningMode string) (location string, httpMatched bool, shMatched bool, err error)
46+
GetCheckoutLocationFromGitUrl(material *sql.GitMaterial, cloningMode string) (location string, httpMatched bool, shMatched bool, err error)
4747
GetCheckoutLocation(gitCtx GitContext, material *sql.GitMaterial, url, checkoutPath string) string
4848
TrimLastGitCommit(gitCommits []*GitCommitBase, count int) []*GitCommitBase
4949
// Clean cleans a directory
@@ -82,7 +82,7 @@ func (impl *RepositoryManagerImpl) IsSpaceAvailableOnDisk() bool {
8282
return availableSpace > int64(impl.configuration.MinLimit)*1024*1024
8383
}
8484

85-
func (impl *RepositoryManagerImpl) GetLocationForMaterial(material *sql.GitMaterial, cloningMode string) (location string, httpMatched bool, shMatched bool, err error) {
85+
func (impl *RepositoryManagerImpl) GetCheckoutLocationFromGitUrl(material *sql.GitMaterial, cloningMode string) (location string, httpMatched bool, shMatched bool, err error) {
8686
//gitRegex := `/(?:git|ssh|https?|git@[-\w.]+):(\/\/)?(.*?)(\.git)(\/?|\#[-\d\w._]+?)$/`
8787
httpsRegex := `^https.*`
8888
httpsMatched, err := regexp.MatchString(httpsRegex, material.Url)

pkg/git/Watcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func (impl GitWatcherImpl) pollGitMaterialAndNotify(material *sql.GitMaterial) e
199199
// there might be the case if ssh private key gets flush from disk, so creating and single retrying in this case
200200
if gitProvider.AuthMode == sql.AUTH_MODE_SSH {
201201
if strings.Contains(material.CheckoutLocation, "/.git") {
202-
location, _, _, err = impl.repositoryManager.GetLocationForMaterial(material, gitCtx.CloningMode)
202+
location, _, _, err = impl.repositoryManager.GetCheckoutLocationFromGitUrl(material, gitCtx.CloningMode)
203203
if err != nil {
204204
impl.logger.Errorw("error in getting clone location ", "material", material, "err", err)
205205
return err

0 commit comments

Comments
 (0)