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
277e3041
Commit
277e3041
authored
Mar 26, 2012
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of submodules in trees
parent
1db12b00
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
13 additions
and
8 deletions
+13
-8
src/tree.h
+1
-1
tests-clar/status/submodules.c
+5
-7
tests/resources/submodules/.gitted/index
+0
-0
tests/resources/submodules/.gitted/logs/HEAD
+1
-0
tests/resources/submodules/.gitted/logs/refs/heads/master
+1
-0
tests/resources/submodules/.gitted/objects/97/896810b3210244a62a82458b8e0819ecfc6850
+4
-0
tests/resources/submodules/.gitted/objects/b6/0fd986699ba4e9e68bea07cf8e793f323ef888
+0
-0
tests/resources/submodules/.gitted/refs/heads/master
+1
-0
No files found.
src/tree.h
View file @
277e3041
...
...
@@ -32,7 +32,7 @@ struct git_treebuilder {
GIT_INLINE
(
unsigned
int
)
entry_is_tree
(
const
struct
git_tree_entry
*
e
)
{
return
e
->
attr
&
040000
;
return
(
S_ISDIR
(
e
->
attr
)
&&
!
S_ISGITLINK
(
e
->
attr
))
;
}
void
git_tree__free
(
git_tree
*
tree
);
...
...
tests-clar/status/submodules.c
View file @
277e3041
...
...
@@ -29,7 +29,7 @@ void test_status_submodules__cleanup(void)
}
static
int
cb_status__count
(
const
char
*
p
,
unsigned
int
s
,
void
*
payload
)
cb_status__
submodule_
count
(
const
char
*
p
,
unsigned
int
s
,
void
*
payload
)
{
volatile
int
*
count
=
(
int
*
)
payload
;
...
...
@@ -50,10 +50,10 @@ void test_status_submodules__0(void)
cl_assert
(
git_path_isfile
(
"submodules/.gitmodules"
));
cl_git_pass
(
git_status_foreach
(
g_repo
,
cb_status__count
,
&
counts
)
git_status_foreach
(
g_repo
,
cb_status__
submodule_
count
,
&
counts
)
);
cl_assert
(
counts
==
7
);
cl_assert
(
counts
==
6
);
}
static
const
char
*
expected_files
[]
=
{
...
...
@@ -62,17 +62,15 @@ static const char *expected_files[] = {
"deleted"
,
"ignored"
,
"modified"
,
"testrepo"
,
"untracked"
};
static
unsigned
int
expected_status
[]
=
{
GIT_STATUS_
INDEX_NEW
|
GIT_STATUS_
WT_MODIFIED
,
GIT_STATUS_WT_MODIFIED
,
GIT_STATUS_INDEX_NEW
,
GIT_STATUS_INDEX_DELETED
,
GIT_STATUS_IGNORED
,
GIT_STATUS_WT_MODIFIED
,
GIT_STATUS_INDEX_NEW
,
/* submodule added in index, but not committed */
GIT_STATUS_WT_NEW
};
...
...
@@ -100,5 +98,5 @@ void test_status_submodules__1(void)
git_status_foreach
(
g_repo
,
cb_status__match
,
&
index
)
);
cl_assert
(
index
==
7
);
cl_assert
(
index
==
6
);
}
tests/resources/submodules/.gitted/index
View file @
277e3041
No preview for this file type
tests/resources/submodules/.gitted/logs/HEAD
View file @
277e3041
0000000000000000000000000000000000000000 09176a980273d801a3e37cc45c84af1366501ed9 Russell Belfer <arrbee@arrbee.com> 1332365253 -0700 commit (initial): initial commit
09176a980273d801a3e37cc45c84af1366501ed9 97896810b3210244a62a82458b8e0819ecfc6850 Russell Belfer <arrbee@arrbee.com> 1332780781 -0700 commit: Setting up gitmodules
tests/resources/submodules/.gitted/logs/refs/heads/master
View file @
277e3041
0000000000000000000000000000000000000000 09176a980273d801a3e37cc45c84af1366501ed9 Russell Belfer <arrbee@arrbee.com> 1332365253 -0700 commit (initial): initial commit
09176a980273d801a3e37cc45c84af1366501ed9 97896810b3210244a62a82458b8e0819ecfc6850 Russell Belfer <arrbee@arrbee.com> 1332780781 -0700 commit: Setting up gitmodules
tests/resources/submodules/.gitted/objects/97/896810b3210244a62a82458b8e0819ecfc6850
0 → 100644
View file @
277e3041
File added
tests/resources/submodules/.gitted/objects/b6/0fd986699ba4e9e68bea07cf8e793f323ef888
0 → 100644
View file @
277e3041
File added
tests/resources/submodules/.gitted/refs/heads/master
0 → 100644
View file @
277e3041
97896810b3210244a62a82458b8e0819ecfc6850
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