Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
630146bd
Commit
630146bd
authored
Feb 04, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address feedback
parent
15760c59
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
src/transports/cred_helpers.c
+7
-3
src/transports/git.c
+4
-4
No files found.
src/transports/cred_helpers.c
View file @
630146bd
...
...
@@ -23,7 +23,9 @@ int git_cred_userpass(
if
(
!
userpass
||
!
userpass
->
password
)
return
-
1
;
/* Username resolution: a username can be passed with the URL, the
* credentials payload, or both. Here's what we do.
* credentials payload, or both. Here's what we do. Note that if we get
* this far, we know that any password the url may contain has already
* failed at least once, so we ignore it.
*
* | Payload | URL | Used |
* +-------------+----------+-----------+
...
...
@@ -32,10 +34,12 @@ int git_cred_userpass(
* | no | yes | url |
* | no | no | FAIL |
*/
if
(
userpass
->
username
)
effective_username
=
userpass
->
username
;
if
(
!
userpass
->
username
&&
user_from_url
)
else
if
(
user_from_url
)
effective_username
=
user_from_url
;
if
(
!
effective_username
)
return
-
1
;
else
return
-
1
;
if
((
GIT_CREDTYPE_USERPASS_PLAINTEXT
&
allowed_types
)
==
0
||
git_cred_userpass_plaintext_new
(
cred
,
effective_username
,
userpass
->
password
)
<
0
)
...
...
src/transports/git.c
View file @
630146bd
...
...
@@ -201,8 +201,8 @@ static int _git_uploadpack_ls(
t
->
current_stream
=
s
;
git__free
(
host
);
git__free
(
port
);
if
(
user
)
git__free
(
user
);
if
(
pass
)
git__free
(
pass
);
git__free
(
user
);
git__free
(
pass
);
return
0
;
on_error:
...
...
@@ -257,8 +257,8 @@ static int _git_receivepack_ls(
t
->
current_stream
=
s
;
git__free
(
host
);
git__free
(
port
);
if
(
user
)
git__free
(
user
);
if
(
pass
)
git__free
(
pass
);
git__free
(
user
);
git__free
(
pass
);
return
0
;
on_error:
...
...
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