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
f0f073b7
Commit
f0f073b7
authored
Jan 22, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1269 from arrbee/tree-iterator-case-sensitivity-bug
Fix case sensitivity bug with tree iterators
parents
2a707d0e
cce548e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
src/iterator.c
+5
-3
tests-clar/diff/iterator.c
+14
-0
No files found.
src/iterator.c
View file @
f0f073b7
...
...
@@ -255,15 +255,17 @@ static int tree_iterator__icase_map_cmp(const void *a, const void *b, void *data
git_tree
*
tree
=
data
;
const
git_tree_entry
*
te1
=
git_tree_entry_byindex
(
tree
,
(
size_t
)
a
);
const
git_tree_entry
*
te2
=
git_tree_entry_byindex
(
tree
,
(
size_t
)
b
);
return
te1
?
(
te2
?
git_tree_entry_icmp
(
te1
,
te2
)
:
1
)
:
-
1
;
}
static
int
tree_iterator__frame_start_icmp
(
const
void
*
key
,
const
void
*
el
ement
)
static
int
tree_iterator__frame_start_icmp
(
const
void
*
key
,
const
void
*
el
)
{
const
tree_iterator_frame
*
tf
=
(
const
tree_iterator_frame
*
)
key
;
const
git_tree_entry
*
te
=
git_tree_entry_byindex
(
tf
->
tree
,
(
size_t
)
element
);
const
git_tree_entry
*
te
=
git_tree_entry_byindex
(
tf
->
tree
,
(
size_t
)
el
);
size_t
minlen
=
min
(
tf
->
startlen
,
te
->
filename_len
);
return
memcmp
(
tf
->
start
,
te
->
filename
,
min
(
tf
->
startlen
,
te
->
filename_len
)
);
return
git__strncasecmp
(
tf
->
start
,
te
->
filename
,
minlen
);
}
static
void
tree_iterator__frame_seek_start
(
tree_iterator_frame
*
tf
)
...
...
tests-clar/diff/iterator.c
View file @
f0f073b7
...
...
@@ -843,8 +843,22 @@ void test_diff_iterator__tree_handles_icase_range(void)
check_tree_range
(
repo
,
"B"
,
"C"
,
false
,
0
);
check_tree_range
(
repo
,
"B"
,
"C"
,
true
,
1
);
check_tree_range
(
repo
,
"b"
,
"c"
,
false
,
1
);
check_tree_range
(
repo
,
"b"
,
"c"
,
true
,
1
);
check_tree_range
(
repo
,
"a"
,
"z"
,
false
,
3
);
check_tree_range
(
repo
,
"a"
,
"z"
,
true
,
4
);
check_tree_range
(
repo
,
"A"
,
"Z"
,
false
,
1
);
check_tree_range
(
repo
,
"A"
,
"Z"
,
true
,
4
);
check_tree_range
(
repo
,
"a"
,
"Z"
,
false
,
0
);
check_tree_range
(
repo
,
"a"
,
"Z"
,
true
,
4
);
check_tree_range
(
repo
,
"A"
,
"z"
,
false
,
4
);
check_tree_range
(
repo
,
"A"
,
"z"
,
true
,
4
);
check_tree_range
(
repo
,
"new.txt"
,
"new.txt"
,
true
,
1
);
check_tree_range
(
repo
,
"new.txt"
,
"new.txt"
,
false
,
1
);
check_tree_range
(
repo
,
"README"
,
"README"
,
true
,
1
);
check_tree_range
(
repo
,
"README"
,
"README"
,
false
,
1
);
}
static
void
check_index_range
(
...
...
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