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
fe345c73
Commit
fe345c73
authored
Feb 09, 2016
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused static functions
parent
8fd74c08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
93 deletions
+0
-93
src/clone.c
+0
-8
src/remote.c
+0
-75
tests/network/remote/rename.c
+0
-10
No files found.
src/clone.c
View file @
fe345c73
...
...
@@ -461,14 +461,6 @@ int git_clone_init_options(git_clone_options *opts, unsigned int version)
return
0
;
}
static
const
char
*
repository_base
(
git_repository
*
repo
)
{
if
(
git_repository_is_bare
(
repo
))
return
git_repository_path
(
repo
);
return
git_repository_workdir
(
repo
);
}
static
bool
can_link
(
const
char
*
src
,
const
char
*
dst
,
int
link
)
{
#ifdef GIT_WIN32
...
...
src/remote.c
View file @
fe345c73
...
...
@@ -547,53 +547,6 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
return
error
;
}
static
int
update_config_refspec
(
const
git_remote
*
remote
,
git_config
*
config
,
int
direction
)
{
git_buf
name
=
GIT_BUF_INIT
;
unsigned
int
push
;
const
char
*
dir
;
size_t
i
;
int
error
=
0
;
const
char
*
cname
;
push
=
direction
==
GIT_DIRECTION_PUSH
;
dir
=
push
?
"push"
:
"fetch"
;
if
(
git_buf_printf
(
&
name
,
"remote.%s.%s"
,
remote
->
name
,
dir
)
<
0
)
return
-
1
;
cname
=
git_buf_cstr
(
&
name
);
/* Clear out the existing config */
while
(
!
error
)
error
=
git_config_delete_multivar
(
config
,
cname
,
".*"
);
if
(
error
!=
GIT_ENOTFOUND
)
return
error
;
for
(
i
=
0
;
i
<
remote
->
refspecs
.
length
;
i
++
)
{
git_refspec
*
spec
=
git_vector_get
(
&
remote
->
refspecs
,
i
);
if
(
spec
->
push
!=
push
)
continue
;
// "$^" is a unmatcheable regexp: it will not match anything at all, so
// all values will be considered new and we will not replace any
// present value.
if
((
error
=
git_config_set_multivar
(
config
,
cname
,
"$^"
,
spec
->
string
))
<
0
)
{
goto
cleanup
;
}
}
giterr_clear
();
error
=
0
;
cleanup:
git_buf_free
(
&
name
);
return
error
;
}
const
char
*
git_remote_name
(
const
git_remote
*
remote
)
{
assert
(
remote
);
...
...
@@ -2103,34 +2056,6 @@ int git_remote_add_push(git_repository *repo, const char *remote, const char *re
return
write_add_refspec
(
repo
,
remote
,
refspec
,
false
);
}
static
int
set_refspecs
(
git_remote
*
remote
,
git_strarray
*
array
,
int
push
)
{
git_vector
*
vec
=
&
remote
->
refspecs
;
git_refspec
*
spec
;
size_t
i
;
/* Start by removing any refspecs of the same type */
for
(
i
=
0
;
i
<
vec
->
length
;
i
++
)
{
spec
=
git_vector_get
(
vec
,
i
);
if
(
spec
->
push
!=
push
)
continue
;
git_refspec__free
(
spec
);
git__free
(
spec
);
git_vector_remove
(
vec
,
i
);
i
--
;
}
/* And now we add the new ones */
for
(
i
=
0
;
i
<
array
->
count
;
i
++
)
{
if
(
add_refspec
(
remote
,
array
->
strings
[
i
],
!
push
)
<
0
)
return
-
1
;
}
return
0
;
}
static
int
copy_refspecs
(
git_strarray
*
array
,
const
git_remote
*
remote
,
unsigned
int
push
)
{
size_t
i
;
...
...
tests/network/remote/rename.c
View file @
fe345c73
...
...
@@ -16,16 +16,6 @@ void test_network_remote_rename__cleanup(void)
cl_git_sandbox_cleanup
();
}
static
int
dont_call_me_cb
(
const
char
*
fetch_refspec
,
void
*
payload
)
{
GIT_UNUSED
(
fetch_refspec
);
GIT_UNUSED
(
payload
);
cl_assert
(
false
);
return
-
1
;
}
void
test_network_remote_rename__renaming_a_remote_moves_related_configuration_section
(
void
)
{
git_strarray
problems
=
{
0
};
...
...
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