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
ece24ef7
Commit
ece24ef7
authored
Aug 21, 2013
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: Don't parse missing urls as empty strings
parent
44bc0c6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
src/remote.c
+1
-1
tests-clar/network/remote/remotes.c
+6
-0
tests-clar/resources/testrepo.git/config
+1
-1
No files found.
src/remote.c
View file @
ece24ef7
...
@@ -308,7 +308,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
...
@@ -308,7 +308,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
if
((
error
=
get_optional_config
(
config
,
&
buf
,
NULL
,
(
void
*
)
&
val
))
<
0
)
if
((
error
=
get_optional_config
(
config
,
&
buf
,
NULL
,
(
void
*
)
&
val
))
<
0
)
goto
cleanup
;
goto
cleanup
;
if
(
val
)
{
if
(
val
&&
strlen
(
val
)
>
0
)
{
remote
->
pushurl
=
git__strdup
(
val
);
remote
->
pushurl
=
git__strdup
(
val
);
GITERR_CHECK_ALLOC
(
remote
->
pushurl
);
GITERR_CHECK_ALLOC
(
remote
->
pushurl
);
}
}
...
...
tests-clar/network/remote/remotes.c
View file @
ece24ef7
...
@@ -367,8 +367,14 @@ void test_network_remote_remotes__can_load_with_an_empty_url(void)
...
@@ -367,8 +367,14 @@ void test_network_remote_remotes__can_load_with_an_empty_url(void)
cl_git_pass
(
git_remote_load
(
&
remote
,
_repo
,
"empty-remote-url"
));
cl_git_pass
(
git_remote_load
(
&
remote
,
_repo
,
"empty-remote-url"
));
cl_assert
(
remote
->
url
==
NULL
);
cl_assert
(
remote
->
pushurl
==
NULL
);
cl_git_fail
(
git_remote_connect
(
remote
,
GIT_DIRECTION_FETCH
));
cl_git_fail
(
git_remote_connect
(
remote
,
GIT_DIRECTION_FETCH
));
cl_assert
(
giterr_last
()
!=
NULL
);
cl_assert
(
giterr_last
()
->
klass
==
GITERR_INVALID
);
git_remote_free
(
remote
);
git_remote_free
(
remote
);
}
}
...
...
tests-clar/resources/testrepo.git/config
View file @
ece24ef7
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
url = git://github.com/libgit2/libgit2
url = git://github.com/libgit2/libgit2
[remote "empty-remote-url"]
[remote "empty-remote-url"]
url =
url =
pushurl =
[remote "test_with_pushurl"]
[remote "test_with_pushurl"]
url = git://github.com/libgit2/fetchlibgit2
url = git://github.com/libgit2/fetchlibgit2
pushurl = git://github.com/libgit2/pushlibgit2
pushurl = git://github.com/libgit2/pushlibgit2
...
...
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