Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 189f2dd

Browse files
committed
Strip .git suffix on dependencies
1 parent 61b1deb commit 189f2dd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

buildserver/deps.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,13 @@ func FetchCommonDeps() {
495495
// Source 1 and 2 are performance optimizations over cloning the whole repo.
496496
var NewDepRepoVFS = func(ctx context.Context, cloneURL *url.URL, rev string, zipURLTemplate *string) (ctxvfs.FileSystem, error) {
497497
if zipURLTemplate != nil {
498-
zipURL := fmt.Sprintf(*zipURLTemplate, path.Join(cloneURL.Host, cloneURL.Path), rev)
498+
var repoName string
499+
if strings.HasSuffix(cloneURL.Path, ".git") {
500+
repoName = strings.TrimSuffix(cloneURL.Path, ".git")
501+
} else {
502+
repoName = cloneURL.Path
503+
}
504+
zipURL := fmt.Sprintf(*zipURLTemplate, path.Join(cloneURL.Host, repoName), rev)
499505
archive, err := vfsutil.NewZipVFS(ctx, zipURL, depZipFetch.Inc, depZipFetchFailed.Inc, false)
500506
if archive != nil && err == nil {
501507
return archive, nil

0 commit comments

Comments
 (0)