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
86c9d3da
Commit
86c9d3da
authored
May 21, 2014
by
Alan Rogers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return GIT_FILEMODE_UNREADABLE for files that fail to stat.
parent
61bef72d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
19 deletions
+25
-19
include/git2/errors.h
+0
-1
include/git2/types.h
+1
-0
src/diff.c
+15
-16
src/path.c
+9
-2
No files found.
include/git2/errors.h
View file @
86c9d3da
...
...
@@ -41,7 +41,6 @@ typedef enum {
GIT_EMERGECONFLICT
=
-
13
,
/*< Merge conflicts prevented operation */
GIT_ELOCKED
=
-
14
,
/*< Lock file prevented operation */
GIT_EMODIFIED
=
-
15
,
/*< Reference value does not match expected */
GIT_EUNREADABLE
=
-
16
,
/*< File or folder is unreadable */
GIT_PASSTHROUGH
=
-
30
,
/*< Internal only */
GIT_ITEROVER
=
-
31
,
/*< Signals end of iteration with iterator */
...
...
include/git2/types.h
View file @
86c9d3da
...
...
@@ -204,6 +204,7 @@ typedef enum {
GIT_FILEMODE_BLOB_EXECUTABLE
=
0100755
,
GIT_FILEMODE_LINK
=
0120000
,
GIT_FILEMODE_COMMIT
=
0160000
,
GIT_FILEMODE_UNREADABLE
=
0170000
,
}
git_filemode_t
;
typedef
struct
git_refspec
git_refspec
;
...
...
src/diff.c
View file @
86c9d3da
...
...
@@ -937,22 +937,17 @@ static int handle_unmatched_new_item(
if
(
recurse_into_dir
)
{
error
=
git_iterator_advance_into
(
&
info
->
nitem
,
info
->
new_iter
);
printf
(
"error advancing into diff %d
\n
"
,
error
);
if
(
error
==
GIT_EUNREADABLE
)
{
delta_type
=
GIT_DELTA_UNREADABLE
;
}
else
{
/* if real error or no error, proceed with iteration */
if
(
error
!=
GIT_ENOTFOUND
)
return
error
;
giterr_clear
();
/* if real error or no error, proceed with iteration */
if
(
error
!=
GIT_ENOTFOUND
)
return
error
;
giterr_clear
();
/* if directory is empty, can't advance into it, so either skip
* it or ignore it
*/
if
(
contains_oitem
)
return
git_iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
delta_type
=
GIT_DELTA_IGNORED
;
}
/* if directory is empty, can't advance into it, so either skip
* it or ignore it
*/
if
(
contains_oitem
)
return
git_iterator_advance
(
&
info
->
nitem
,
info
->
new_iter
);
delta_type
=
GIT_DELTA_IGNORED
;
}
}
...
...
@@ -998,8 +993,12 @@ static int handle_unmatched_new_item(
}
}
else
if
(
nitem
->
mode
==
GIT_FILEMODE_UNREADABLE
)
{
delta_type
=
GIT_DELTA_UNREADABLE
;
}
/* Actually create the record for this item if necessary */
if
(
error
!=
GIT_EUNREADABLE
&&
(
error
=
diff_delta__from_one
(
diff
,
delta_type
,
nitem
))
!=
0
)
if
((
error
=
diff_delta__from_one
(
diff
,
delta_type
,
nitem
))
!=
0
)
return
error
;
/* If user requested TYPECHANGE records, then check for that instead of
...
...
src/path.c
View file @
86c9d3da
...
...
@@ -560,10 +560,10 @@ int git_path_set_error(int errno_value, const char *path, const char *action)
case
EEXIST
:
giterr_set
(
GITERR_OS
,
"Failed %s - '%s' already exists"
,
action
,
path
);
return
GIT_EEXISTS
;
default:
giterr_set
(
GITERR_OS
,
"Could not %s '%s'"
,
action
,
path
);
return
GIT_EUNREADABLE
;
return
-
1
;
}
}
...
...
@@ -1110,6 +1110,13 @@ int git_path_dirload_with_stat(
git_vector_remove
(
contents
,
i
--
);
continue
;
}
/* Treat the file as unreadable if we get any other error */
if
(
error
!=
0
)
{
giterr_clear
();
error
=
0
;
ps
->
st
.
st_mode
=
GIT_FILEMODE_UNREADABLE
;
continue
;
}
break
;
}
...
...
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