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
e49c98e6
Commit
e49c98e6
authored
Jan 20, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2065 from ethomson/submodule_unmodified
"Uninitialized" submodules are "unmodified"
parents
d62bf0bf
b554ca5d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
include/git2/submodule.h
+2
-1
tests/status/submodules.c
+17
-0
No files found.
include/git2/submodule.h
View file @
e49c98e6
...
@@ -97,7 +97,8 @@ typedef enum {
...
@@ -97,7 +97,8 @@ typedef enum {
(((S) & GIT_SUBMODULE_STATUS__INDEX_FLAGS) == 0)
(((S) & GIT_SUBMODULE_STATUS__INDEX_FLAGS) == 0)
#define GIT_SUBMODULE_STATUS_IS_WD_UNMODIFIED(S) \
#define GIT_SUBMODULE_STATUS_IS_WD_UNMODIFIED(S) \
(((S) & GIT_SUBMODULE_STATUS__WD_FLAGS) == 0)
(((S) & (GIT_SUBMODULE_STATUS__WD_FLAGS & \
~GIT_SUBMODULE_STATUS_WD_UNINITIALIZED)) == 0)
#define GIT_SUBMODULE_STATUS_IS_WD_DIRTY(S) \
#define GIT_SUBMODULE_STATUS_IS_WD_DIRTY(S) \
(((S) & (GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED | \
(((S) & (GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED | \
...
...
tests/status/submodules.c
View file @
e49c98e6
...
@@ -221,3 +221,20 @@ void test_status_submodules__dirty_workdir_only(void)
...
@@ -221,3 +221,20 @@ void test_status_submodules__dirty_workdir_only(void)
git_status_foreach_ext
(
g_repo
,
&
opts
,
cb_status__match
,
&
counts
));
git_status_foreach_ext
(
g_repo
,
&
opts
,
cb_status__match
,
&
counts
));
cl_assert_equal_i
(
6
,
counts
.
entry_count
);
cl_assert_equal_i
(
6
,
counts
.
entry_count
);
}
}
void
test_status_submodules__uninitialized
(
void
)
{
git_repository
*
cloned_repo
;
git_status_list
*
statuslist
;
g_repo
=
cl_git_sandbox_init
(
"submod2"
);
cl_git_pass
(
git_clone
(
&
cloned_repo
,
"submod2"
,
"submod2-clone"
,
NULL
));
cl_git_pass
(
git_status_list_new
(
&
statuslist
,
cloned_repo
,
NULL
));
cl_assert_equal_i
(
0
,
git_status_list_entrycount
(
statuslist
));
git_status_list_free
(
statuslist
);
git_repository_free
(
cloned_repo
);
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