Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"URL received is not a git repository." #70

Closed
rafaveira3 opened this issue Sep 4, 2018 · 3 comments
Closed

"URL received is not a git repository." #70

rafaveira3 opened this issue Sep 4, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@rafaveira3
Copy link
Contributor

The following repository was stated as not a git repository:

gitlab@gitlab.example.com:example/example.git

@rafaveira3 rafaveira3 added the bug Something isn't working label Sep 4, 2018
@rafaveira3 rafaveira3 added this to the Fix all bugs found milestone Sep 4, 2018
@rafaveira3
Copy link
Contributor Author

Review this regexp:

// check-01: is this a git repository URL?
regexpGit := `^(?:git|https?|ssh|git@[-\w.]+):(//)?(.*?)(\.git)(/?|#[-\d\w._]+?)$`
valid, err := regexp.MatchString(regexpGit, repository.URL)
if err != nil {
    return c.JSON(http.StatusBadRequest, map[string]string{"result": "error", "details": "Internal error."})
}
if !valid {
    return c.JSON(http.StatusBadRequest, map[string]string{"result": "error", "details": "URL received is not a git repository."})
}

@mdjunior
Copy link
Contributor

mdjunior commented Sep 5, 2018

Using this repo, the URL should be: ssh://gitlab@gitlab.example.com:example/example.git or ssh://gitlab@gitlab.example.com/example/example.git to match regex.
According with documentation, URLs can not have :, so the example provided using SSH should be: ssh://gitlab@gitlab.example.com/example/example.git

@rafaveira3
Copy link
Contributor Author

rafaveira3 commented Nov 13, 2018

Sending https://github.com/tsuru/cst.git we still receive the message Not a Git Repository! We need to fix this Regex!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants