I do NOT want to check if the remote repository exists. I just want to test a string and return true if the string is in the valid format for a git repo.
I'm writing a groovy script and wish to do a quick check if a string represents a valid possible git repo.
For instance if the following strings are entered the test should return true:
http://example.com/my-project.git
file:///absolute/path/to/my-project.git
ssh:user@example.com:my-project
my-project
The following strings should fail the test and cause false to be returned:
fil://example.com/my-project.git
ssh:user|example.com:my-project
I'm hoping there is a git command that can do this quick test for me and I can call git from the groovy script. I say this because I'd like to use whatever is compiled into git to do the test as opposed to re-implementing the regular expression (or parser) that already exists in git. If I try the latter then inevitably I'll miss something.