Skip to content

Commit b089ccb

Browse files
Gregory Mankesfumblehool
authored andcommitted
simplify the regex
1 parent 0a406c7 commit b089ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

submodule.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020
ErrSubmoduleNotInitialized = errors.New("submodule not initialized")
2121

2222
// gitSubmoduleSSHRegex matches a submodule repository that connects over ssh
23-
gitSubmoduleSSHRegex = regexp.MustCompile(`^\"?(ssh://)?[A-Za-z_]+@[a-zA-Z0-9._-]+:[a-zA-Z0-9./._-]+\/.*\"?$`)
23+
gitSubmoduleSSHRegex = regexp.MustCompile(`^\"?(?:ssh|git@[-\w.]+):(\/\/)?(.*?)(\.git)\"?$`)
2424
)
2525

2626
// Submodule a submodule allows you to keep another Git repository in a

0 commit comments

Comments
 (0)