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
bd5e3082
Commit
bd5e3082
authored
Apr 06, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: support SHA256 for remote refs
parent
d1c92a95
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
src/libgit2/remote.c
+14
-6
No files found.
src/libgit2/remote.c
View file @
bd5e3082
...
...
@@ -1631,7 +1631,10 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
const
git_refspec
*
spec
;
const
char
*
refname
;
int
error
;
git_oid
zero_id
=
GIT_OID_SHA1_ZERO
;
git_oid
zero_id
;
GIT_ASSERT
(
remote
&&
remote
->
repo
);
git_oid_clear
(
&
zero_id
,
remote
->
repo
->
oid_type
);
if
(
callbacks
)
GIT_ERROR_CHECK_VERSION
(
callbacks
,
GIT_REMOTE_CALLBACKS_VERSION
,
"git_remote_callbacks"
);
...
...
@@ -1733,9 +1736,12 @@ static int update_ref(
const
git_remote_callbacks
*
callbacks
)
{
git_reference
*
ref
;
git_oid
old_id
=
GIT_OID_SHA1_ZERO
;
git_oid
old_id
;
int
error
;
GIT_ASSERT
(
remote
&&
remote
->
repo
);
git_oid_clear
(
&
old_id
,
remote
->
repo
->
oid_type
);
error
=
git_reference_name_to_id
(
&
old_id
,
remote
->
repo
,
ref_name
);
if
(
error
<
0
&&
error
!=
GIT_ENOTFOUND
)
...
...
@@ -1779,6 +1785,8 @@ static int update_one_tip(
int
valid
;
int
error
;
GIT_ASSERT
(
remote
&&
remote
->
repo
);
if
((
error
=
git_repository_odb__weakptr
(
&
odb
,
remote
->
repo
))
<
0
)
goto
done
;
...
...
@@ -1839,7 +1847,7 @@ static int update_one_tip(
}
if
(
error
==
GIT_ENOTFOUND
)
{
git_oid_clear
(
&
old
,
GIT_OID_SHA1
);
git_oid_clear
(
&
old
,
remote
->
repo
->
oid_type
);
error
=
0
;
if
(
autotag
&&
(
error
=
git_vector_insert
(
update_heads
,
head
))
<
0
)
...
...
@@ -1885,7 +1893,7 @@ static int update_tips_for_spec(
int
error
=
0
;
size_t
i
;
GIT_ASSERT_ARG
(
remote
);
GIT_ASSERT_ARG
(
remote
&&
remote
->
repo
);
if
(
git_refspec__parse
(
&
tagspec
,
GIT_REFSPEC_TAGS
,
true
)
<
0
)
return
-
1
;
...
...
@@ -1901,10 +1909,10 @@ static int update_tips_for_spec(
}
/* Handle specified oid sources */
if
(
git_oid__is_hexstr
(
spec
->
src
,
GIT_OID_SHA1
))
{
if
(
git_oid__is_hexstr
(
spec
->
src
,
remote
->
repo
->
oid_type
))
{
git_oid
id
;
if
((
error
=
git_oid__fromstr
(
&
id
,
spec
->
src
,
GIT_OID_SHA1
))
<
0
)
if
((
error
=
git_oid__fromstr
(
&
id
,
spec
->
src
,
remote
->
repo
->
oid_type
))
<
0
)
goto
on_error
;
if
(
spec
->
dst
&&
...
...
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