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
412de9a6
Commit
412de9a6
authored
Dec 20, 2010
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made gitfo_mkdir_recurs() gracefully recover when a given directory already exists.
parent
40c44d2f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
src/fileops.c
+6
-1
No files found.
src/fileops.c
View file @
412de9a6
...
...
@@ -323,10 +323,15 @@ int gitfo_mkdir_recurs(const char *path, int mode)
error
=
GIT_SUCCESS
;
pp
=
path_copy
;
while
(
error
==
0
&&
(
sp
=
strchr
(
pp
,
'/'
))
!=
0
)
{
while
(
error
==
GIT_SUCCESS
&&
(
sp
=
strchr
(
pp
,
'/'
))
!=
0
)
{
if
(
sp
!=
pp
&&
gitfo_isdir
(
path_copy
)
<
GIT_SUCCESS
)
{
*
sp
=
0
;
error
=
gitfo_mkdir
(
path_copy
,
mode
);
/* Do not choke while trying to recreate an existing directory */
if
(
errno
==
EEXIST
)
error
=
GIT_SUCCESS
;
*
sp
=
'/'
;
}
...
...
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