Skip to content

Commit

Permalink
simplify the regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregory Mankes authored and fumblehool committed Nov 28, 2024
1 parent 0a406c7 commit b089ccb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion submodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
ErrSubmoduleNotInitialized = errors.New("submodule not initialized")

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

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

0 comments on commit b089ccb

Please sign in to comment.