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
e871d89b
Commit
e871d89b
authored
Jan 28, 2014
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure moving a branch updates the reflog
parent
ccf6ce5c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
tests/refs/branches/move.c
+19
-0
No files found.
tests/refs/branches/move.c
View file @
e871d89b
...
@@ -186,3 +186,22 @@ void test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD(
...
@@ -186,3 +186,22 @@ void test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD(
cl_assert_equal_s
(
"refs/heads/master2"
,
git_reference_name
(
branch
));
cl_assert_equal_s
(
"refs/heads/master2"
,
git_reference_name
(
branch
));
git_reference_free
(
branch
);
git_reference_free
(
branch
);
}
}
void
test_refs_branches_move__updates_the_reflog
(
void
)
{
git_reference
*
branch
;
git_reference
*
new_branch
;
git_reflog
*
log
;
const
git_reflog_entry
*
entry
;
cl_git_pass
(
git_reference_lookup
(
&
branch
,
repo
,
"refs/heads/master"
));
cl_git_pass
(
git_branch_move
(
&
new_branch
,
branch
,
"master2"
,
0
,
NULL
,
"message"
));
cl_git_pass
(
git_reflog_read
(
&
log
,
repo
,
git_reference_name
(
new_branch
)));
entry
=
git_reflog_entry_byindex
(
log
,
0
);
cl_assert_equal_s
(
"message"
,
git_reflog_entry_message
(
entry
));
git_reference_free
(
branch
);
git_reference_free
(
new_branch
);
git_reflog_free
(
log
);
}
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