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
991bf691
Unverified
Commit
991bf691
authored
Jun 06, 2018
by
Patrick Steinhardt
Committed by
GitHub
Jun 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4673 from pks-t/pks/submodule-dupes-simplify-test
tests: submodule: do not rely on config iteration order
parents
54990d75
8178c70f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
22 deletions
+9
-22
tests/submodule/lookup.c
+9
-22
No files found.
tests/submodule/lookup.c
View file @
991bf691
...
...
@@ -132,7 +132,7 @@ void test_submodule_lookup__foreach(void)
cl_assert_equal_i
(
8
,
data
.
count
);
}
static
int
sm_dummy
_cb
(
git_submodule
*
sm
,
const
char
*
name
,
void
*
payload
)
static
int
foreach
_cb
(
git_submodule
*
sm
,
const
char
*
name
,
void
*
payload
)
{
GIT_UNUSED
(
sm
);
GIT_UNUSED
(
name
);
...
...
@@ -142,20 +142,15 @@ static int sm_dummy_cb(git_submodule *sm, const char *name, void *payload)
void
test_submodule_lookup__duplicated_path
(
void
)
{
/*
* Manually invoke cleanup methods to remove leftovers
* from `setup_fixture_submod2`
*/
cl_git_sandbox_cleanup
();
cl_fixture_cleanup
(
"submod2_target"
);
g_repo
=
setup_fixture_submodules
();
cl_git_rewritefile
(
"submod2/.gitmodules"
,
"[submodule
\"
sm1
\"
]
\n
"
" path = duplicated-path
\n
"
" url = sm1
\n
"
"[submodule
\"
sm2
\"
]
\n
"
" path = duplicated-path
\n
"
" url = sm2
\n
"
);
/*
* This should fail, as the submodules repo has an
* invalid gitmodules file with duplicated paths.
*/
cl_git_fail
(
git_submodule_foreach
(
g_repo
,
sm_dummy_cb
,
NULL
));
cl_git_fail
(
git_submodule_foreach
(
g_repo
,
foreach_cb
,
NULL
));
}
void
test_submodule_lookup__lookup_even_with_unborn_head
(
void
)
...
...
@@ -456,14 +451,6 @@ void test_submodule_lookup__lookup_in_bare_repository_fails(void)
cl_git_fail
(
git_submodule_lookup
(
&
sm
,
g_repo
,
"nonexisting"
));
}
static
int
foreach_cb
(
git_submodule
*
sm
,
const
char
*
name
,
void
*
payload
)
{
GIT_UNUSED
(
sm
);
GIT_UNUSED
(
name
);
GIT_UNUSED
(
payload
);
return
0
;
}
void
test_submodule_lookup__foreach_in_bare_repository_fails
(
void
)
{
cl_git_sandbox_cleanup
();
...
...
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