Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
585eb705
Commit
585eb705
authored
Nov 26, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix http push with namespaces. Allow use of username as login
parent
1d857aae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
app/roles/repository.rb
app/roles/repository.rb
+1
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+8
-4
No files found.
app/roles/repository.rb
View file @
585eb705
...
...
@@ -185,7 +185,7 @@ module Repository
end
def
http_url_to_repo
http_url
=
[
Gitlab
.
config
.
url
,
"/"
,
path
,
".git"
].
join
(
''
)
http_url
=
[
Gitlab
.
config
.
url
,
"/"
,
path
_with_namespace
,
".git"
].
join
(
''
)
end
# Check if current branch name is marked as protected in the system
...
...
lib/gitlab/backend/grack_auth.rb
View file @
585eb705
...
...
@@ -4,10 +4,14 @@ module Grack
def
valid?
# Authentication with username and password
email
,
password
=
@auth
.
credentials
self
.
user
=
User
.
find_by_email
(
email
)
login
,
password
=
@auth
.
credentials
self
.
user
=
User
.
find_by_email
(
login
)
||
User
.
find_by_username
(
login
)
return
false
unless
user
.
try
(
:valid_password?
,
password
)
email
=
user
.
email
# Set GL_USER env variable
ENV
[
'GL_USER'
]
=
email
# Pass Gitolite update hook
...
...
@@ -18,8 +22,8 @@ module Grack
@env
[
'SCRIPT_NAME'
]
=
""
# Find project by PATH_INFO from env
if
m
=
/^\/([\w\.-]+)\.git/
.
match
(
@request
.
path_info
).
to_a
self
.
project
=
Project
.
find_
by_path
(
m
.
last
)
if
m
=
/^\/([\w\.
\/
-]+)\.git/
.
match
(
@request
.
path_info
).
to_a
self
.
project
=
Project
.
find_
with_namespace
(
m
.
last
)
return
false
unless
project
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment