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
7f1dd445
Commit
7f1dd445
authored
Feb 18, 2021
by
panda
Committed by
Edward Thomson
Jun 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: Initialize case_sorted to GIT_VECTOR_INIT
This is for extra safety within write_entries
parent
f4c05192
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
src/index.c
+4
-5
No files found.
src/index.c
View file @
7f1dd445
...
...
@@ -2826,7 +2826,7 @@ static int write_entries(git_index *index, git_filebuf *file)
{
int
error
=
0
;
size_t
i
;
git_vector
case_sorted
,
*
entries
;
git_vector
case_sorted
=
GIT_VECTOR_INIT
,
*
entries
=
NULL
;
git_index_entry
*
entry
;
const
char
*
last
=
NULL
;
...
...
@@ -2834,7 +2834,7 @@ static int write_entries(git_index *index, git_filebuf *file)
* to re-sort it case-sensitively before writing */
if
(
index
->
ignore_case
)
{
if
((
error
=
git_vector_dup
(
&
case_sorted
,
&
index
->
entries
,
git_index_entry_cmp
))
<
0
)
return
error
;
goto
done
;
git_vector_sort
(
&
case_sorted
);
entries
=
&
case_sorted
;
...
...
@@ -2852,9 +2852,8 @@ static int write_entries(git_index *index, git_filebuf *file)
last
=
entry
->
path
;
}
if
(
index
->
ignore_case
)
git_vector_free
(
&
case_sorted
);
done
:
git_vector_free
(
&
case_sorted
);
return
error
;
}
...
...
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