Skip to content
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.

Support namespaces for repository #154

Merged
merged 2 commits into from
Aug 26, 2014
Merged

Conversation

scorphus
Copy link
Contributor

No description provided.

}
return repositories, users, nil
}

func GrantAccess(w http.ResponseWriter, r *http.Request) {
func checkNamespaceRequirement(namespace string, hasNamespace bool) error {
if hasNamespace {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namespaceRequired is a better name.

r, err := regexp.Compile(`git-([\w-]+) '/?([\w-]+)\.git'`)
// (git-[a-z-]+) '/?(([\w-+.@]+)/)?([\w-]+)\.git'
func parseGitCommand() (command, name string, err error) {
r, err := regexp.Compile(`(git-[a-z-]+) '/?([\w-+@][\w-+.@]*/)?([\w-]+)\.git'`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this regex removing the namespace group.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely! 👍

andrewsmedina added a commit that referenced this pull request Aug 26, 2014
Support namespaces for repository
@andrewsmedina andrewsmedina merged commit 2cb2e32 into tsuru:master Aug 26, 2014
@andrewsmedina
Copy link
Contributor

@scorphus thank you!

@scorphus
Copy link
Contributor Author

I'll comment on that regex as we agreed a bit earlier 😉

@scorphus scorphus deleted the namespaces branch August 26, 2014 22:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants