summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@sap.com>2022-04-01 14:09:58 +0200
committerSandro Jäckel <sandro.jaeckel@sap.com>2022-04-01 14:32:57 +0200
commit1c5cc4947add7cfc5fdbe0cce1e67450ce5d2bd3 (patch)
tree81229238e7cd25f1ad248da2c16e523d529cfd72
parent2dd6ab16c2346a7d7ed8f9b740f33457573dfdd7 (diff)
downloadgofu-1c5cc4947add7cfc5fdbe0cce1e67450ce5d2bd3.tar.gz
rtree get: ignore .git when matching repos
-rw-r--r--internal/rtree/index.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/rtree/index.go b/internal/rtree/index.go
index 45b6522..226689a 100644
--- a/internal/rtree/index.go
+++ b/internal/rtree/index.go
@@ -226,7 +226,8 @@ func (i *Index) FindRepo(rawRemoteURL string, allowClone bool) (*Repo, error) {
for _, repo := range i.Repos {
isCandidate := false
for _, remote := range repo.Remotes {
- if remoteURL == remote.URL {
+ // be flexible about .git ending in remote
+ if remoteURL == remote.URL || remoteURL+".git" == remote.URL || remoteURL == remote.URL+".git" {
return repo, nil
}
if basename == path.Base(remote.URL.CanonicalURL()) {