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
12d4ed4d
Commit
12d4ed4d
authored
Mar 08, 2014
by
Jan Melcher
Committed by
Russell Belfer
Apr 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test git_submodule_add_setup with relative url
parent
8f4e5275
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
tests/submodule/modify.c
+24
-0
No files found.
tests/submodule/modify.c
View file @
12d4ed4d
...
...
@@ -9,6 +9,10 @@ static git_repository *g_repo = NULL;
#define SM_LIBGIT2 "sm_libgit2"
#define SM_LIBGIT2B "sm_libgit2b"
#define SM_RELATIVE_URL "../TestGitRepository"
#define SM_RELATIVE_RESOLVED_URL "https://github.com/libgit2/TestGitRepository"
#define SM_RELATIVE "TestGitRepository"
void
test_submodule_modify__initialize
(
void
)
{
g_repo
=
setup_fixture_submod2
();
...
...
@@ -62,6 +66,26 @@ void test_submodule_modify__add(void)
git_config_free
(
cfg
);
}
void
test_submodule_modify__add_with_relative_url
(
void
)
{
git_submodule
*
sm
;
git_config
*
cfg
;
const
char
*
s
;
git_repository
*
repo
;
/* setup_fixture_submod2 does not work here because it does not set up origin configuration */
cl_git_pass
(
git_clone
(
&
repo
,
SM_LIBGIT2_URL
,
"./sandbox/submodules_cloned"
,
NULL
));
cl_git_pass
(
git_submodule_add_setup
(
&
sm
,
repo
,
SM_RELATIVE_URL
,
SM_RELATIVE
,
1
)
);
cl_git_pass
(
git_repository_config
(
&
cfg
,
repo
));
cl_git_pass
(
git_config_get_string
(
&
s
,
cfg
,
"submodule."
SM_RELATIVE
".url"
));
cl_assert_equal_s
(
s
,
SM_RELATIVE_RESOLVED_URL
);
git_config_free
(
cfg
);
}
static
int
delete_one_config
(
const
git_config_entry
*
entry
,
void
*
payload
)
{
git_config
*
cfg
=
payload
;
...
...
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