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
0105b55e
Commit
0105b55e
authored
Jun 27, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add another submodule test of dirty wd
parent
c0e529f3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
tests-clar/diff/submodules.c
+39
-0
No files found.
tests-clar/diff/submodules.c
View file @
0105b55e
...
...
@@ -121,6 +121,45 @@ void test_diff_submodules__dirty_submodule(void)
git_diff_list_free
(
diff
);
}
void
test_diff_submodules__dirty_submodule_2
(
void
)
{
git_diff_options
opts
=
GIT_DIFF_OPTIONS_INIT
;
git_diff_list
*
diff
=
NULL
;
char
*
smpath
=
"testrepo"
;
static
const
char
*
expected_none
[]
=
{
NULL
,
"<END>"
};
static
const
char
*
expected_dirty
[]
=
{
"diff --git a/testrepo b/testrepo
\n
index a65fedf..a65fedf 160000
\n
--- a/testrepo
\n
+++ b/testrepo
\n
@@ -1 +1 @@
\n
-Subproject commit a65fedf39aefe402d3bb6e24df4d4f5fe4547750
\n
+Subproject commit a65fedf39aefe402d3bb6e24df4d4f5fe4547750-dirty
\n
"
,
/* testrepo.git */
"<END>"
};
setup_submodules
();
cl_git_pass
(
git_submodule_reload_all
(
g_repo
));
opts
.
flags
=
GIT_DIFF_INCLUDE_IGNORED
|
GIT_DIFF_INCLUDE_UNTRACKED
|
GIT_DIFF_INCLUDE_UNMODIFIED
;
opts
.
pathspec
.
count
=
1
;
opts
.
pathspec
.
strings
=
&
smpath
;
cl_git_pass
(
git_diff_index_to_workdir
(
&
diff
,
g_repo
,
NULL
,
&
opts
));
check_diff_patches
(
diff
,
expected_none
);
git_diff_list_free
(
diff
);
cl_git_rewritefile
(
"submodules/testrepo/README"
,
"heyheyhey"
);
cl_git_mkfile
(
"submodules/testrepo/all_new.txt"
,
"never seen before"
);
cl_git_pass
(
git_diff_index_to_workdir
(
&
diff
,
g_repo
,
NULL
,
&
opts
));
check_diff_patches
(
diff
,
expected_dirty
);
git_diff_list_free
(
diff
);
cl_git_pass
(
git_submodule_reload_all
(
g_repo
));
cl_git_pass
(
git_diff_index_to_workdir
(
&
diff
,
g_repo
,
NULL
,
&
opts
));
check_diff_patches
(
diff
,
expected_dirty
);
git_diff_list_free
(
diff
);
}
void
test_diff_submodules__submod2_index_to_wd
(
void
)
{
git_diff_options
opts
=
GIT_DIFF_OPTIONS_INIT
;
...
...
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