mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
--get-urlmatch does not support explicit region specification
This commit is contained in:
parent
97c992f9a0
commit
ab37eb66ff
|
|
@ -117,12 +117,15 @@ func LocalRepositoryFromURL(remoteURL *url.URL) (*LocalRepository, error) {
|
|||
|
||||
func getRoot(u string) (string, error) {
|
||||
prim := os.Getenv(envGhqRoot)
|
||||
var err error
|
||||
if prim != "" {
|
||||
return prim, nil
|
||||
}
|
||||
prim, err := gitconfig.Do("--path", "--get-urlmatch", "ghq.root", u)
|
||||
if err != nil && !gitconfig.IsNotFound(err) {
|
||||
return "", err
|
||||
if !codecommitLikeURLPattern.MatchString(u) {
|
||||
prim, err = gitconfig.Do("--path", "--get-urlmatch", "ghq.root", u)
|
||||
if err != nil && !gitconfig.IsNotFound(err) {
|
||||
return "", err
|
||||
}
|
||||
}
|
||||
if prim == "" {
|
||||
prim, err = primaryLocalRepositoryRoot()
|
||||
|
|
|
|||
Loading…
Reference in a new issue