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
c5df10f4
Commit
c5df10f4
authored
Nov 30, 2012
by
Jameson Miller
Committed by
Russell Belfer
Jan 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Failing test on git_checkout_tree when removing directories
parent
d0951175
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
tests-clar/checkout/tree.c
+27
-0
No files found.
tests-clar/checkout/tree.c
View file @
c5df10f4
...
...
@@ -48,6 +48,33 @@ void test_checkout_tree__can_checkout_a_subdirectory_from_a_commit(void)
cl_assert_equal_i
(
true
,
git_path_isfile
(
"./testrepo/ab/de/fgh/1.txt"
));
}
void
test_checkout_tree__can_checkout_and_remove_directory
(
void
)
{
git_reference
*
head
;
cl_assert_equal_i
(
false
,
git_path_isdir
(
"./testrepo/ab/"
));
// Checkout brach "subtrees" and update HEAD, so that HEAD matches the current working tree
cl_git_pass
(
git_revparse_single
(
&
g_object
,
g_repo
,
"subtrees"
));
cl_git_pass
(
git_checkout_tree
(
g_repo
,
g_object
,
&
g_opts
));
cl_git_pass
(
git_reference_lookup
(
&
head
,
g_repo
,
"HEAD"
));
cl_git_pass
(
git_reference_symbolic_set_target
(
head
,
"refs/heads/subtrees"
));
git_reference_free
(
head
);
cl_assert_equal_i
(
true
,
git_path_isdir
(
"./testrepo/ab/"
));
cl_assert_equal_i
(
true
,
git_path_isfile
(
"./testrepo/ab/de/2.txt"
));
cl_assert_equal_i
(
true
,
git_path_isfile
(
"./testrepo/ab/de/fgh/1.txt"
));
// Checkout brach "master" and update HEAD, so that HEAD matches the current working tree
cl_git_pass
(
git_revparse_single
(
&
g_object
,
g_repo
,
"master"
));
cl_git_pass
(
git_checkout_tree
(
g_repo
,
g_object
,
&
g_opts
));
cl_git_pass
(
git_reference_lookup
(
&
head
,
g_repo
,
"HEAD"
));
cl_git_pass
(
git_reference_symbolic_set_target
(
head
,
"refs/heads/master"
));
git_reference_free
(
head
);
// This directory should no longer exist
cl_assert_equal_i
(
false
,
git_path_isdir
(
"./testrepo/ab/"
));
}
void
test_checkout_tree__can_checkout_a_subdirectory_from_a_subtree
(
void
)
{
char
*
entries
[]
=
{
"de/"
};
...
...
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