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
b6204260
Commit
b6204260
authored
Feb 10, 2016
by
joshaber
Committed by
Edward Thomson
Mar 23, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Failing test.
parent
ae86aa5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
10 deletions
+53
-10
tests/status/worktree.c
+53
-10
No files found.
tests/status/worktree.c
View file @
b6204260
...
...
@@ -218,6 +218,58 @@ void test_status_worktree__swap_subdir_with_recurse_and_pathspec(void)
cl_assert_equal_i
(
0
,
counts
.
wrong_sorted_path
);
}
static
void
stage_and_commit
(
git_repository
*
repo
,
const
char
*
path
)
{
git_index
*
index
;
cl_git_pass
(
git_repository_index
(
&
index
,
repo
));
cl_git_pass
(
git_index_add_bypath
(
index
,
path
));
cl_repo_commit_from_index
(
NULL
,
repo
,
NULL
,
1323847743
,
"Initial commit
\n
"
);
git_index_free
(
index
);
}
void
test_status_worktree__within_subdir
(
void
)
{
status_entry_counts
counts
;
git_repository
*
repo
=
cl_git_sandbox_init
(
"status"
);
git_status_options
opts
=
GIT_STATUS_OPTIONS_INIT
;
char
*
paths
[]
=
{
"zzz_new_dir"
};
git_strarray
pathsArray
;
/* first alter the contents of the worktree */
cl_git_mkfile
(
"status/.new_file"
,
"dummy"
);
cl_git_pass
(
git_futils_mkdir_r
(
"status/zzz_new_dir"
,
0777
));
cl_git_mkfile
(
"status/zzz_new_dir/new_file"
,
"dummy"
);
cl_git_mkfile
(
"status/zzz_new_file"
,
"dummy"
);
cl_git_mkfile
(
"status/wut"
,
"dummy"
);
stage_and_commit
(
repo
,
"zzz_new_dir/new_file"
);
/* now get status */
memset
(
&
counts
,
0x0
,
sizeof
(
status_entry_counts
));
counts
.
expected_entry_count
=
entry_count4
;
counts
.
expected_paths
=
entry_paths4
;
counts
.
expected_statuses
=
entry_statuses4
;
counts
.
debug
=
true
;
opts
.
flags
=
GIT_STATUS_OPT_INCLUDE_UNTRACKED
|
GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS
|
GIT_STATUS_OPT_DISABLE_PATHSPEC_MATCH
;
pathsArray
.
count
=
1
;
pathsArray
.
strings
=
paths
;
opts
.
pathspec
=
pathsArray
;
// We committed zzz_new_dir/new_file above. It shouldn't be reported.
cl_git_pass
(
git_status_foreach_ext
(
repo
,
&
opts
,
cb_status__normal
,
&
counts
)
);
cl_assert_equal_i
(
0
,
counts
.
entry_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_status_flags_count
);
cl_assert_equal_i
(
0
,
counts
.
wrong_sorted_path
);
}
/* this test is equivalent to t18-status.c:singlestatus0 */
void
test_status_worktree__single_file
(
void
)
{
...
...
@@ -692,16 +744,6 @@ void test_status_worktree__conflict_has_no_oid(void)
git_status_list_free
(
statuslist
);
}
static
void
stage_and_commit
(
git_repository
*
repo
,
const
char
*
path
)
{
git_index
*
index
;
cl_git_pass
(
git_repository_index
(
&
index
,
repo
));
cl_git_pass
(
git_index_add_bypath
(
index
,
path
));
cl_repo_commit_from_index
(
NULL
,
repo
,
NULL
,
1323847743
,
"Initial commit
\n
"
);
git_index_free
(
index
);
}
static
void
assert_ignore_case
(
bool
should_ignore_case
,
int
expected_lower_cased_file_status
,
...
...
@@ -1228,3 +1270,4 @@ void test_status_worktree__with_directory_in_pathlist(void)
status
->
index_to_workdir
->
old_file
.
path
);
}
}
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