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
d0951175
Commit
d0951175
authored
Dec 06, 2012
by
Marvin Gülker
Committed by
Russell Belfer
Jan 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test to demonstrate wrong checkout behaviour
parent
6fee906c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests-clar/checkout/tree.c
+20
-0
No files found.
tests-clar/checkout/tree.c
View file @
d0951175
...
...
@@ -85,3 +85,23 @@ void test_checkout_tree__calls_progress_callback(void)
cl_assert_equal_i
(
was_called
,
true
);
}
void
test_checkout_tree__doesnt_write_unrequested_files_to_worktree
(
void
)
{
git_oid
master_oid
;
git_oid
chomped_oid
;
git_commit
*
p_master_commit
;
git_commit
*
p_chomped_commit
;
git_checkout_opts
opts
=
GIT_CHECKOUT_OPTS_INIT
;
git_oid_fromstr
(
&
master_oid
,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750"
);
git_oid_fromstr
(
&
chomped_oid
,
"e90810b8df3e80c413d903f631643c716887138d"
);
cl_git_pass
(
git_commit_lookup
(
&
p_master_commit
,
g_repo
,
&
master_oid
));
cl_git_pass
(
git_commit_lookup
(
&
p_chomped_commit
,
g_repo
,
&
chomped_oid
));
/* A GIT_CHECKOUT_DEFAULT checkout is not allowed to add any file to the
* working tree from the index as it is supposed to be a dry run. */
opts
.
checkout_strategy
=
GIT_CHECKOUT_DEFAULT
;
git_checkout_tree
(
g_repo
,
(
git_object
*
)
p_chomped_commit
,
&
opts
);
cl_assert_equal_i
(
false
,
git_path_isfile
(
"testrepo/readme.txt"
));
}
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