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
f47bc8ff
Commit
f47bc8ff
authored
May 20, 2014
by
Alan Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Skip unreadable files for now.
parent
90553479
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
src/diff.c
+3
-3
src/status.c
+6
-2
No files found.
src/diff.c
View file @
f47bc8ff
...
@@ -925,14 +925,14 @@ static int handle_unmatched_new_item(
...
@@ -925,14 +925,14 @@ static int handle_unmatched_new_item(
error
=
git_iterator_advance_into
(
&
info
->
nitem
,
info
->
new_iter
);
error
=
git_iterator_advance_into
(
&
info
->
nitem
,
info
->
new_iter
);
/* if real error or no error, proceed with iteration */
/* if real error or no error, proceed with iteration */
if
(
error
!=
GIT_ENOTFOUND
)
if
(
error
!=
GIT_ENOTFOUND
&&
error
!=
GIT_EUNREADABLE
)
return
error
;
return
error
;
giterr_clear
();
giterr_clear
();
/* if directory is empty, can't advance into it, so either skip
/* if directory is empty, can't advance into it, so either skip
* it or ignore it
* it or ignore it
*/
*/
if
(
contains_oitem
)
if
(
contains_oitem
&&
error
!=
GIT_EUNREADABLE
)
return
git_iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
return
git_iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
delta_type
=
GIT_DELTA_IGNORED
;
delta_type
=
GIT_DELTA_IGNORED
;
}
}
...
@@ -981,7 +981,7 @@ static int handle_unmatched_new_item(
...
@@ -981,7 +981,7 @@ static int handle_unmatched_new_item(
}
}
/* Actually create the record for this item if necessary */
/* Actually create the record for this item if necessary */
if
((
error
=
diff_delta__from_one
(
diff
,
delta_type
,
nitem
))
!=
0
)
if
(
error
!=
GIT_EUNREADABLE
&&
(
error
=
diff_delta__from_one
(
diff
,
delta_type
,
nitem
))
!=
0
)
return
error
;
return
error
;
/* If user requested TYPECHANGE records, then check for that instead of
/* If user requested TYPECHANGE records, then check for that instead of
...
...
src/status.c
View file @
f47bc8ff
...
@@ -329,8 +329,10 @@ int git_status_list_new(
...
@@ -329,8 +329,10 @@ int git_status_list_new(
if
(
show
!=
GIT_STATUS_SHOW_INDEX_ONLY
)
{
if
(
show
!=
GIT_STATUS_SHOW_INDEX_ONLY
)
{
if
((
error
=
git_diff_index_to_workdir
(
if
((
error
=
git_diff_index_to_workdir
(
&
status
->
idx2wd
,
repo
,
index
,
&
diffopt
))
<
0
)
&
status
->
idx2wd
,
repo
,
index
,
&
diffopt
))
<
0
)
{
printf
(
"git_diff_index_to_workdir failed with error %d
\n
"
,
error
);
goto
done
;
goto
done
;
}
if
((
flags
&
GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR
)
!=
0
&&
if
((
flags
&
GIT_STATUS_OPT_RENAMES_INDEX_TO_WORKDIR
)
!=
0
&&
(
error
=
git_diff_find_similar
(
status
->
idx2wd
,
&
findopt
))
<
0
)
(
error
=
git_diff_find_similar
(
status
->
idx2wd
,
&
findopt
))
<
0
)
...
@@ -407,8 +409,10 @@ int git_status_foreach_ext(
...
@@ -407,8 +409,10 @@ int git_status_foreach_ext(
size_t
i
;
size_t
i
;
int
error
=
0
;
int
error
=
0
;
if
((
error
=
git_status_list_new
(
&
status
,
repo
,
opts
))
<
0
)
if
((
error
=
git_status_list_new
(
&
status
,
repo
,
opts
))
<
0
)
{
printf
(
"git_status_list_new failed with error %d
\n
"
,
error
);
return
error
;
return
error
;
}
git_vector_foreach
(
&
status
->
paired
,
i
,
status_entry
)
{
git_vector_foreach
(
&
status
->
paired
,
i
,
status_entry
)
{
const
char
*
path
=
status_entry
->
head_to_index
?
const
char
*
path
=
status_entry
->
head_to_index
?
...
...
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