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
fb03a223
Commit
fb03a223
authored
Jun 13, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test has to work on case sensitive systems
parent
eefef642
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
tests-clar/index/tests.c
+13
-2
No files found.
tests-clar/index/tests.c
View file @
fb03a223
...
...
@@ -422,12 +422,15 @@ void test_index_tests__preserves_case(void)
git_repository
*
repo
;
git_index
*
index
;
const
git_index_entry
*
entry
;
int
index_caps
;
cl_set_cleanup
(
&
cleanup_myrepo
,
NULL
);
cl_git_pass
(
git_repository_init
(
&
repo
,
"./myrepo"
,
0
));
cl_git_pass
(
git_repository_index
(
&
index
,
repo
));
index_caps
=
git_index_caps
(
index
);
cl_git_rewritefile
(
"myrepo/test.txt"
,
"hey there
\n
"
);
cl_git_pass
(
git_index_add_bypath
(
index
,
"test.txt"
));
...
...
@@ -435,14 +438,22 @@ void test_index_tests__preserves_case(void)
cl_git_rewritefile
(
"myrepo/TEST.txt"
,
"hello again
\n
"
);
cl_git_pass
(
git_index_add_bypath
(
index
,
"TEST.txt"
));
cl_assert
(
git_index_entrycount
(
index
)
==
1
);
if
(
index_caps
&
GIT_INDEXCAP_IGNORE_CASE
)
cl_assert_equal_i
(
1
,
(
int
)
git_index_entrycount
(
index
));
else
cl_assert_equal_i
(
2
,
(
int
)
git_index_entrycount
(
index
));
/* Test access by path instead of index */
cl_assert
((
entry
=
git_index_get_bypath
(
index
,
"test.txt"
,
0
))
!=
NULL
);
cl_assert
((
entry
=
git_index_get_bypath
(
index
,
"TEST.txt"
,
0
))
!=
NULL
);
/* The path should *not* have changed without an explicit remove */
cl_assert
(
git__strcmp
(
entry
->
path
,
"test.txt"
)
==
0
);
cl_assert
((
entry
=
git_index_get_bypath
(
index
,
"TEST.txt"
,
0
))
!=
NULL
);
if
(
index_caps
&
GIT_INDEXCAP_IGNORE_CASE
)
/* The path should *not* have changed without an explicit remove */
cl_assert
(
git__strcmp
(
entry
->
path
,
"test.txt"
)
==
0
);
else
cl_assert
(
git__strcmp
(
entry
->
path
,
"TEST.txt"
)
==
0
);
git_index_free
(
index
);
git_repository_free
(
repo
);
...
...
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