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
0aa60336
Commit
0aa60336
authored
May 19, 2015
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3132 from libgit2/cmn/path-direach-cberror
Provide error messages for git_path_direach operations
parents
9042693e
edef91ee
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
src/fileops.c
+5
-1
src/path.c
+3
-1
No files found.
src/fileops.c
View file @
0aa60336
...
...
@@ -703,6 +703,9 @@ static int cp_by_fd(int ifd, int ofd, bool close_fd_when_done)
error
=
(
int
)
len
;
}
if
(
error
<
0
)
giterr_set
(
GITERR_OS
,
"write error while copying file"
);
if
(
close_fd_when_done
)
{
p_close
(
ifd
);
p_close
(
ofd
);
...
...
@@ -861,7 +864,8 @@ static int _cp_r_callback(void *ref, git_buf *from)
/* make symlink or regular file */
if
(
info
->
flags
&
GIT_CPDIR_LINK_FILES
)
{
error
=
p_link
(
from
->
ptr
,
info
->
to
.
ptr
);
if
((
error
=
p_link
(
from
->
ptr
,
info
->
to
.
ptr
))
<
0
)
giterr_set
(
GITERR_OS
,
"failed to link '%s'"
,
from
->
ptr
);
}
else
if
(
S_ISLNK
(
from_st
.
st_mode
))
{
error
=
cp_link
(
from
->
ptr
,
info
->
to
.
ptr
,
(
size_t
)
from_st
.
st_size
);
}
else
{
...
...
src/path.c
View file @
0aa60336
...
...
@@ -1060,11 +1060,13 @@ int git_path_direach(
if
((
error
=
git_buf_put
(
path
,
de_path
,
de_len
))
<
0
)
break
;
giterr_clear
();
error
=
fn
(
arg
,
path
);
git_buf_truncate
(
path
,
wd_len
);
/* restore path */
if
(
error
!=
0
)
{
/* Only set our own error if the callback did not set one already */
if
(
error
!=
0
&&
!
giterr_last
())
{
giterr_set_after_callback
(
error
);
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