Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
isindir committed Dec 7, 2024
1 parent afc9ee5 commit a725834
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gitget/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ func (repo *Repo) GitPull() {
} else {
log.Debugf(
"%s: Skip pulling upstream changes for '%s' which is not a branch",
repo.sha, colorRef.Sprintf(repo.Ref))
repo.sha, colorRef.Sprintf("%s", repo.Ref))
}
}

Expand Down Expand Up @@ -519,7 +519,7 @@ func (repo *Repo) ProcessRepoBasedOnCurrentBranch() {
if !stayOnRef {
repo.GitCheckout(currentBranch)
} else {
log.Debugf("%s: Stay on ref branch '%s'", repo.sha, colorRef.Sprintf(repo.Ref))
log.Debugf("%s: Stay on ref branch '%s'", repo.sha, colorRef.Sprintf("%s", repo.Ref))
}
}
}
Expand Down Expand Up @@ -643,7 +643,7 @@ func (repo *Repo) EnsureGitlabMirrorExists() {
}
}

func DecomposeGitURL(gitURL string) (string, string, string) {
func DecomposeGitURL(gitURL string) (baseURL, fullName, shortName string) {
// input: [email protected]:b/c/d.git or https://abc.com/b/c/d.git -> abc.com/b/c/d
// remove unwanted parts of the git repo url
re := regexp.MustCompile(`.git$|^https://|^git@`)
Expand All @@ -653,10 +653,10 @@ func DecomposeGitURL(gitURL string) (string, string, string) {

// baseURL and longPath for checking repo existence ( abc.com/b/c/d -> abc.com , b/c/d )
urlParts := strings.SplitN(url, "/", 2)
baseURL, fullName := urlParts[0], urlParts[1]
baseURL, fullName = urlParts[0], urlParts[1]

// baseURL and project Name for creating missing repository ( abc.com/b/c/d -> abc.com/b/c , d)
_, shortName := filepath.Split(url)
_, shortName = filepath.Split(url)

// ( abc.com/b/c/d -> abc.com, b/c/d, d )
return baseURL, fullName, shortName
Expand Down

0 comments on commit a725834

Please sign in to comment.