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
a6b50808
Commit
a6b50808
authored
Oct 30, 2013
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs: adjust to the new reflog API
parent
ca84e058
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
19 deletions
+7
-19
src/refs.c
+3
-15
tests/refs/createwithlog.c
+2
-2
tests/refs/settargetwithlog.c
+2
-2
No files found.
src/refs.c
View file @
a6b50808
...
...
@@ -328,27 +328,15 @@ static int feed_reflog(
const
char
*
log_message
)
{
git_reflog
*
reflog
=
NULL
;
git_oid
peeled_ref_oid
;
int
error
;
if
((
error
=
git_reflog_read
(
&
reflog
,
ref
))
<
0
)
goto
cleanup
;
if
((
error
=
git_reference_name_to_id
(
&
peeled_ref_oid
,
git_reference_owner
(
ref
),
git_reference_name
(
ref
)))
<
0
)
goto
cleanup
;
if
((
error
=
git_reflog_append
(
reflog
,
&
peeled_ref_oid
,
signature
,
log_message
))
<
0
)
goto
cleanup
;
error
=
git_reflog_write
(
reflog
);
cleanup:
git_reflog_free
(
reflog
);
return
error
;
return
0
;
return
git_reflog_append_to
(
git_reference_owner
(
ref
),
git_reference_name
(
ref
),
&
peeled_ref_oid
,
signature
,
log_message
);
}
static
int
reference__create
(
...
...
tests/refs/createwithlog.c
View file @
a6b50808
...
...
@@ -38,7 +38,7 @@ void test_refs_createwithlog__creating_a_direct_reference_adds_a_reflog_entry(vo
cl_git_pass
(
git_reference_create_with_log
(
&
reference
,
g_repo
,
name
,
&
id
,
0
,
signature
,
message
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
referenc
e
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
g_repo
,
nam
e
));
cl_assert_equal_sz
(
1
,
git_reflog_entrycount
(
reflog
));
entry
=
git_reflog_entry_byindex
(
reflog
,
0
);
...
...
@@ -69,7 +69,7 @@ void test_refs_createwithlog__creating_a_symbolic_reference_adds_a_reflog_entry(
cl_git_pass
(
git_reference_symbolic_create_with_log
(
&
reference
,
g_repo
,
name
,
current_head_target
,
0
,
signature
,
message
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
referenc
e
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
g_repo
,
nam
e
));
cl_assert_equal_sz
(
1
,
git_reflog_entrycount
(
reflog
));
entry
=
git_reflog_entry_byindex
(
reflog
,
0
);
...
...
tests/refs/settargetwithlog.c
View file @
a6b50808
...
...
@@ -41,7 +41,7 @@ void test_refs_settargetwithlog__updating_a_direct_reference_adds_a_reflog_entry
cl_git_pass
(
git_reference_set_target_with_log
(
&
reference_out
,
reference
,
&
target_id
,
signature
,
message
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
reference_out
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
g_repo
,
br2_name
));
entry
=
git_reflog_entry_byindex
(
reflog
,
0
);
cl_assert
(
git_oid_cmp
(
&
current_id
,
&
entry
->
oid_old
)
==
0
);
...
...
@@ -80,7 +80,7 @@ void test_refs_settargetwithlog__updating_a_symbolic_reference_adds_a_reflog_ent
cl_assert_equal_s
(
br2_name
,
git_reference_symbolic_target
(
reference_out
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
referenc
e
));
cl_git_pass
(
git_reflog_read
(
&
reflog
,
g_repo
,
nam
e
));
entry
=
git_reflog_entry_byindex
(
reflog
,
0
);
cl_assert
(
git_oid_streq
(
&
entry
->
oid_old
,
master_tip
)
==
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