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
0642c143
Commit
0642c143
authored
Jan 02, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move `url` to last place in parameter list
parent
3de22567
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
10 deletions
+10
-10
examples/network/fetch.c
+1
-1
examples/network/ls-remote.c
+1
-1
include/git2/remote.h
+3
-3
src/remote.c
+1
-1
tests-clar/network/remotelocal.c
+1
-1
tests-clar/network/remoterename.c
+1
-1
tests-clar/network/remotes.c
+2
-2
No files found.
examples/network/fetch.c
View file @
0642c143
...
@@ -76,7 +76,7 @@ int fetch(git_repository *repo, int argc, char **argv)
...
@@ -76,7 +76,7 @@ int fetch(git_repository *repo, int argc, char **argv)
// Figure out whether it's a named remote or a URL
// Figure out whether it's a named remote or a URL
printf
(
"Fetching %s for repo %p
\n
"
,
argv
[
1
],
repo
);
printf
(
"Fetching %s for repo %p
\n
"
,
argv
[
1
],
repo
);
if
(
git_remote_load
(
&
remote
,
repo
,
argv
[
1
])
<
0
)
{
if
(
git_remote_load
(
&
remote
,
repo
,
argv
[
1
])
<
0
)
{
if
(
git_remote_create_inmemory
(
&
remote
,
repo
,
argv
[
1
],
NULL
)
<
0
)
if
(
git_remote_create_inmemory
(
&
remote
,
repo
,
NULL
,
argv
[
1
]
)
<
0
)
return
-
1
;
return
-
1
;
}
}
...
...
examples/network/ls-remote.c
View file @
0642c143
...
@@ -21,7 +21,7 @@ static int use_unnamed(git_repository *repo, const char *url)
...
@@ -21,7 +21,7 @@ static int use_unnamed(git_repository *repo, const char *url)
// Create an instance of a remote from the URL. The transport to use
// Create an instance of a remote from the URL. The transport to use
// is detected from the URL
// is detected from the URL
error
=
git_remote_create_inmemory
(
&
remote
,
repo
,
url
,
NULL
);
error
=
git_remote_create_inmemory
(
&
remote
,
repo
,
NULL
,
url
);
if
(
error
<
0
)
if
(
error
<
0
)
goto
cleanup
;
goto
cleanup
;
...
...
include/git2/remote.h
View file @
0642c143
...
@@ -61,15 +61,15 @@ GIT_EXTERN(int) git_remote_create(
...
@@ -61,15 +61,15 @@ GIT_EXTERN(int) git_remote_create(
*
*
* @param out pointer to the new remote object
* @param out pointer to the new remote object
* @param repo the associated repository. May be NULL for a "dangling" remote.
* @param repo the associated repository. May be NULL for a "dangling" remote.
* @param url the remote repository's URL
* @param fetch the fetch refspec to use for this remote. May be NULL for defaults.
* @param fetch the fetch refspec to use for this remote. May be NULL for defaults.
* @param url the remote repository's URL
* @return 0 or an error code
* @return 0 or an error code
*/
*/
GIT_EXTERN
(
int
)
git_remote_create_inmemory
(
GIT_EXTERN
(
int
)
git_remote_create_inmemory
(
git_remote
**
out
,
git_remote
**
out
,
git_repository
*
repo
,
git_repository
*
repo
,
const
char
*
url
,
const
char
*
fetch
,
const
char
*
fetch
);
const
char
*
url
);
/**
/**
* Sets the owning repository for the remote. This is only allowed on
* Sets the owning repository for the remote. This is only allowed on
...
...
src/remote.c
View file @
0642c143
...
@@ -183,7 +183,7 @@ on_error:
...
@@ -183,7 +183,7 @@ on_error:
return
-
1
;
return
-
1
;
}
}
int
git_remote_create_inmemory
(
git_remote
**
out
,
git_repository
*
repo
,
const
char
*
url
,
const
char
*
fetch
)
int
git_remote_create_inmemory
(
git_remote
**
out
,
git_repository
*
repo
,
const
char
*
fetch
,
const
char
*
url
)
{
{
int
error
;
int
error
;
git_remote
*
remote
;
git_remote
*
remote
;
...
...
tests-clar/network/remotelocal.c
View file @
0642c143
...
@@ -50,7 +50,7 @@ static void connect_to_local_repository(const char *local_repository)
...
@@ -50,7 +50,7 @@ static void connect_to_local_repository(const char *local_repository)
{
{
git_buf_sets
(
&
file_path_buf
,
cl_git_path_url
(
local_repository
));
git_buf_sets
(
&
file_path_buf
,
cl_git_path_url
(
local_repository
));
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
repo
,
git_buf_cstr
(
&
file_path_buf
),
NULL
));
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
repo
,
NULL
,
git_buf_cstr
(
&
file_path_buf
)
));
cl_git_pass
(
git_remote_connect
(
remote
,
GIT_DIRECTION_FETCH
));
cl_git_pass
(
git_remote_connect
(
remote
,
GIT_DIRECTION_FETCH
));
}
}
...
...
tests-clar/network/remoterename.c
View file @
0642c143
...
@@ -167,7 +167,7 @@ void test_network_remoterename__cannot_rename_an_inmemory_remote(void)
...
@@ -167,7 +167,7 @@ void test_network_remoterename__cannot_rename_an_inmemory_remote(void)
{
{
git_remote
*
remote
;
git_remote
*
remote
;
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
_repo
,
"file:///blah"
,
NULL
));
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
_repo
,
NULL
,
"file:///blah"
));
cl_git_fail
(
git_remote_rename
(
remote
,
"newname"
,
NULL
,
NULL
));
cl_git_fail
(
git_remote_rename
(
remote
,
"newname"
,
NULL
,
NULL
));
git_remote_free
(
remote
);
git_remote_free
(
remote
);
...
...
tests-clar/network/remotes.c
View file @
0642c143
...
@@ -255,7 +255,7 @@ void test_network_remotes__cannot_save_an_inmemory_remote(void)
...
@@ -255,7 +255,7 @@ void test_network_remotes__cannot_save_an_inmemory_remote(void)
{
{
git_remote
*
remote
;
git_remote
*
remote
;
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
_repo
,
"git://github.com/libgit2/libgit2"
,
NULL
));
cl_git_pass
(
git_remote_create_inmemory
(
&
remote
,
_repo
,
NULL
,
"git://github.com/libgit2/libgit2"
));
cl_assert_equal_p
(
NULL
,
git_remote_name
(
remote
));
cl_assert_equal_p
(
NULL
,
git_remote_name
(
remote
));
...
@@ -318,7 +318,7 @@ void test_network_remotes__check_structure_version(void)
...
@@ -318,7 +318,7 @@ void test_network_remotes__check_structure_version(void)
git_remote_free
(
_remote
);
git_remote_free
(
_remote
);
_remote
=
NULL
;
_remote
=
NULL
;
cl_git_pass
(
git_remote_create_inmemory
(
&
_remote
,
_repo
,
"test-protocol://localhost"
,
NULL
));
cl_git_pass
(
git_remote_create_inmemory
(
&
_remote
,
_repo
,
NULL
,
"test-protocol://localhost"
));
transport
.
version
=
0
;
transport
.
version
=
0
;
cl_git_fail
(
git_remote_set_transport
(
_remote
,
&
transport
));
cl_git_fail
(
git_remote_set_transport
(
_remote
,
&
transport
));
...
...
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