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
fa9a969d
Commit
fa9a969d
authored
May 20, 2015
by
Edward Thomson
Committed by
Edward Thomson
May 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index_add_all: include untracked files in new subdirs
parent
cd3f3c28
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletions
+27
-1
src/index.c
+4
-1
tests/index/addall.c
+23
-0
No files found.
src/index.c
View file @
fa9a969d
...
...
@@ -2683,7 +2683,10 @@ static int index_apply_to_wd_diff(git_index *index, int action, const git_strarr
opts
.
flags
=
GIT_DIFF_INCLUDE_TYPECHANGE
;
if
(
action
==
INDEX_ACTION_ADDALL
)
{
opts
.
flags
|=
GIT_DIFF_INCLUDE_UNTRACKED
|
GIT_DIFF_RECURSE_IGNORED_DIRS
;
opts
.
flags
|=
GIT_DIFF_INCLUDE_UNTRACKED
|
GIT_DIFF_RECURSE_UNTRACKED_DIRS
|
GIT_DIFF_RECURSE_IGNORED_DIRS
;
if
(
flags
==
GIT_INDEX_ADD_FORCE
)
opts
.
flags
|=
GIT_DIFF_INCLUDE_IGNORED
;
}
...
...
tests/index/addall.c
View file @
fa9a969d
...
...
@@ -282,6 +282,29 @@ void test_index_addall__repo_lifecycle(void)
git_index_free
(
index
);
}
void
test_index_addall__files_in_folders
(
void
)
{
git_index
*
index
;
git_strarray
paths
=
{
NULL
,
0
};
addall_create_test_repo
(
true
);
cl_git_pass
(
git_repository_index
(
&
index
,
g_repo
));
cl_git_pass
(
git_index_add_all
(
index
,
NULL
,
0
,
NULL
,
NULL
));
check_stat_data
(
index
,
TEST_DIR
"/file.bar"
,
true
);
check_status
(
g_repo
,
2
,
0
,
0
,
0
,
0
,
0
,
1
);
cl_must_pass
(
p_mkdir
(
TEST_DIR
"/subdir"
,
0777
));
cl_git_mkfile
(
TEST_DIR
"/subdir/file"
,
"hello!
\n
"
);
check_status
(
g_repo
,
2
,
0
,
0
,
1
,
0
,
0
,
1
);
cl_git_pass
(
git_index_add_all
(
index
,
NULL
,
0
,
NULL
,
NULL
));
check_status
(
g_repo
,
3
,
0
,
0
,
0
,
0
,
0
,
1
);
git_index_free
(
index
);
}
static
int
addall_match_prefix
(
const
char
*
path
,
const
char
*
matched_pathspec
,
void
*
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