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
99feb988
Commit
99feb988
authored
Nov 07, 2013
by
Victor Garcia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding doc for new param and test to check fetch spec is correctly added
parent
0fe522d1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
include/git2/remote.h
+3
-1
tests-clar/network/remote/remotes.c
+11
-1
No files found.
include/git2/remote.h
View file @
99feb988
...
...
@@ -27,13 +27,15 @@ GIT_BEGIN_DECL
typedef
int
(
*
git_remote_rename_problem_cb
)(
const
char
*
problematic_refspec
,
void
*
payload
);
/**
* Add a remote with the default fetch refspec to the repository's configuration. This
* Add a remote with the provided fetch refspec (or default if NULL) to the repository's
* configuration. This
* calls git_remote_save before returning.
*
* @param out the resulting remote
* @param repo the repository in which to create the remote
* @param name the remote's name
* @param url the remote's url
* @param fetch the remote fetch value
* @return 0, GIT_EINVALIDSPEC, GIT_EEXISTS or an error code
*/
GIT_EXTERN
(
int
)
git_remote_create
(
...
...
tests-clar/network/remote/remotes.c
View file @
99feb988
...
...
@@ -450,7 +450,6 @@ void test_network_remote_remotes__cannot_create_a_remote_which_name_conflicts_wi
assert_cannot_create_remote
(
"test"
,
GIT_EEXISTS
);
}
void
test_network_remote_remotes__cannot_create_a_remote_which_name_is_invalid
(
void
)
{
assert_cannot_create_remote
(
"/"
,
GIT_EINVALIDSPEC
);
...
...
@@ -459,6 +458,17 @@ void test_network_remote_remotes__cannot_create_a_remote_which_name_is_invalid(v
assert_cannot_create_remote
(
"a.lock"
,
GIT_EINVALIDSPEC
);
}
void
test_network_remote_remotes__create_a_remote_with_custom_fetch_spec
(
void
)
{
git_remote
*
remote
;
git_strarray
array
;
cl_git_pass
(
git_remote_create
(
&
remote
,
_repo
,
"test-new"
,
"git://github.com/libgit2/libgit2"
,
"+refs/*:refs/*"
));
git_remote_get_fetch_refspecs
(
&
array
,
remote
);
cl_assert_equal_s
(
"+refs/*:refs/*"
,
array
.
strings
[
0
]);
git_remote_free
(
remote
);
}
static
const
char
*
fetch_refspecs
[]
=
{
"+refs/heads/*:refs/remotes/origin/*"
,
"refs/tags/*:refs/tags/*"
,
...
...
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