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
68e73791
Unverified
Commit
68e73791
authored
Jun 29, 2018
by
Edward Thomson
Committed by
GitHub
Jun 29, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4709 from pks-t/pks/refspec-dispose
refspec: rename `git_refspec__free` to `git_refspec__dispose`
parents
01574d40
af3088e4
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
21 deletions
+21
-21
src/fetch.c
+2
-2
src/push.c
+1
-1
src/refspec.c
+3
-3
src/refspec.h
+1
-1
src/remote.c
+7
-7
src/transports/smart.c
+1
-1
src/transports/smart_protocol.c
+1
-1
tests/network/refspecs.c
+5
-5
No files found.
src/fetch.c
View file @
68e73791
...
...
@@ -78,7 +78,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
goto
cleanup
;
error
=
git_refspec__dwim_one
(
&
remote
->
active_refspecs
,
&
head
,
&
remote
->
refs
);
git_refspec__
fre
e
(
&
head
);
git_refspec__
dispos
e
(
&
head
);
if
(
error
<
0
)
goto
cleanup
;
...
...
@@ -96,7 +96,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
}
cleanup:
git_refspec__
fre
e
(
&
tagspec
);
git_refspec__
dispos
e
(
&
tagspec
);
return
error
;
}
...
...
src/push.c
View file @
68e73791
...
...
@@ -83,7 +83,7 @@ static void free_refspec(push_spec *spec)
if
(
spec
==
NULL
)
return
;
git_refspec__
fre
e
(
&
spec
->
refspec
);
git_refspec__
dispos
e
(
&
spec
->
refspec
);
git__free
(
spec
);
}
...
...
src/refspec.c
View file @
68e73791
...
...
@@ -144,11 +144,11 @@ int git_refspec__parse(git_refspec *refspec, const char *input, bool is_fetch)
giterr_set
(
GITERR_INVALID
,
"'%s' is not a valid refspec."
,
input
);
git_refspec__
fre
e
(
refspec
);
git_refspec__
dispos
e
(
refspec
);
return
-
1
;
}
void
git_refspec__
fre
e
(
git_refspec
*
refspec
)
void
git_refspec__
dispos
e
(
git_refspec
*
refspec
)
{
if
(
refspec
==
NULL
)
return
;
...
...
@@ -181,7 +181,7 @@ int git_refspec_parse(git_refspec **out_refspec, const char *input, int is_fetch
void
git_refspec_free
(
git_refspec
*
refspec
)
{
git_refspec__
fre
e
(
refspec
);
git_refspec__
dispos
e
(
refspec
);
git__free
(
refspec
);
}
...
...
src/refspec.h
View file @
68e73791
...
...
@@ -30,7 +30,7 @@ int git_refspec__parse(
const char *str,
bool is_fetch);
void git_refspec__
fre
e(git_refspec *refspec);
void git_refspec__
dispos
e(git_refspec *refspec);
int git_refspec__serialize(git_buf *out, const git_refspec *refspec);
...
...
src/remote.c
View file @
68e73791
...
...
@@ -44,7 +44,7 @@ static int add_refspec_to(git_vector *vector, const char *string, bool is_fetch)
spec
->
push
=
!
is_fetch
;
if
(
git_vector_insert
(
vector
,
spec
)
<
0
)
{
git_refspec__
fre
e
(
spec
);
git_refspec__
dispos
e
(
spec
);
git__free
(
spec
);
return
-
1
;
}
...
...
@@ -117,7 +117,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
return
error
;
}
git_refspec__
fre
e
(
&
spec
);
git_refspec__
dispos
e
(
&
spec
);
if
((
error
=
git_buf_printf
(
&
var
,
fmt
,
name
))
<
0
)
return
error
;
...
...
@@ -826,7 +826,7 @@ static void free_refspecs(git_vector *vec)
git_refspec
*
spec
;
git_vector_foreach
(
vec
,
i
,
spec
)
{
git_refspec__
fre
e
(
spec
);
git_refspec__
dispos
e
(
spec
);
git__free
(
spec
);
}
...
...
@@ -1416,13 +1416,13 @@ static int update_tips_for_spec(
goto
on_error
;
git_vector_free
(
&
update_heads
);
git_refspec__
fre
e
(
&
tagspec
);
git_refspec__
dispos
e
(
&
tagspec
);
git_buf_dispose
(
&
refname
);
return
0
;
on_error:
git_vector_free
(
&
update_heads
);
git_refspec__
fre
e
(
&
tagspec
);
git_refspec__
dispos
e
(
&
tagspec
);
git_buf_dispose
(
&
refname
);
return
-
1
;
...
...
@@ -1607,7 +1607,7 @@ int git_remote_update_tips(
out:
git_vector_free
(
&
refs
);
git_refspec__
fre
e
(
&
tagspec
);
git_refspec__
dispos
e
(
&
tagspec
);
return
error
;
}
...
...
@@ -2045,7 +2045,7 @@ int git_remote_is_valid_name(
error
=
git_refspec__parse
(
&
refspec
,
git_buf_cstr
(
&
buf
),
true
);
git_buf_dispose
(
&
buf
);
git_refspec__
fre
e
(
&
refspec
);
git_refspec__
dispos
e
(
&
refspec
);
giterr_clear
();
return
error
==
0
;
...
...
src/transports/smart.c
View file @
68e73791
...
...
@@ -192,7 +192,7 @@ static void free_symrefs(git_vector *symrefs)
size_t
i
;
git_vector_foreach
(
symrefs
,
i
,
spec
)
{
git_refspec__
fre
e
(
spec
);
git_refspec__
dispos
e
(
spec
);
git__free
(
spec
);
}
...
...
src/transports/smart_protocol.c
View file @
68e73791
...
...
@@ -131,7 +131,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr)
on_invalid:
giterr_set
(
GITERR_NET
,
"remote sent invalid symref"
);
git_refspec__
fre
e
(
mapping
);
git_refspec__
dispos
e
(
mapping
);
git__free
(
mapping
);
return
-
1
;
}
...
...
tests/network/refspecs.c
View file @
68e73791
...
...
@@ -8,7 +8,7 @@ static void assert_refspec(unsigned int direction, const char *input, bool is_ex
int
error
;
error
=
git_refspec__parse
(
&
refspec
,
input
,
direction
==
GIT_DIRECTION_FETCH
);
git_refspec__
fre
e
(
&
refspec
);
git_refspec__
dispos
e
(
&
refspec
);
if
(
is_expected_to_be_valid
)
cl_assert_equal_i
(
0
,
error
);
...
...
@@ -98,7 +98,7 @@ static void assert_valid_transform(const char *refspec, const char *name, const
cl_assert_equal_s
(
result
,
buf
.
ptr
);
git_buf_dispose
(
&
buf
);
git_refspec__
fre
e
(
&
spec
);
git_refspec__
dispos
e
(
&
spec
);
}
void
test_network_refspecs__transform_mid_star
(
void
)
...
...
@@ -120,7 +120,7 @@ static void assert_invalid_transform(const char *refspec, const char *name)
cl_git_fail
(
git_refspec_transform
(
&
buf
,
&
spec
,
name
));
git_buf_dispose
(
&
buf
);
git_refspec__
fre
e
(
&
spec
);
git_refspec__
dispos
e
(
&
spec
);
}
void
test_network_refspecs__invalid
(
void
)
...
...
@@ -138,7 +138,7 @@ static void assert_invalid_rtransform(const char *refspec, const char *name)
cl_git_fail
(
git_refspec_rtransform
(
&
buf
,
&
spec
,
name
));
git_buf_dispose
(
&
buf
);
git_refspec__
fre
e
(
&
spec
);
git_refspec__
dispos
e
(
&
spec
);
}
void
test_network_refspecs__invalid_reverse
(
void
)
...
...
@@ -156,7 +156,7 @@ void test_network_refspecs__matching(void)
cl_assert_equal_s
(
""
,
spec
.
src
);
cl_assert_equal_s
(
""
,
spec
.
dst
);
git_refspec__
fre
e
(
&
spec
);
git_refspec__
dispos
e
(
&
spec
);
}
void
test_network_refspecs__parse_free
(
void
)
...
...
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