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
1da6329f
Commit
1da6329f
authored
Jun 29, 2018
by
Etienne Samson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worktree: don't return "untyped" negative numbers as error codes
parent
292a6eca
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
src/worktree.c
+4
-11
No files found.
src/worktree.c
View file @
1da6329f
...
@@ -234,37 +234,30 @@ void git_worktree_free(git_worktree *wt)
...
@@ -234,37 +234,30 @@ void git_worktree_free(git_worktree *wt)
int
git_worktree_validate
(
const
git_worktree
*
wt
)
int
git_worktree_validate
(
const
git_worktree
*
wt
)
{
{
int
err
=
0
;
assert
(
wt
);
assert
(
wt
);
if
(
!
is_worktree_dir
(
wt
->
gitdir_path
))
{
if
(
!
is_worktree_dir
(
wt
->
gitdir_path
))
{
giterr_set
(
GITERR_WORKTREE
,
giterr_set
(
GITERR_WORKTREE
,
"Worktree gitdir ('%s') is not valid"
,
"Worktree gitdir ('%s') is not valid"
,
wt
->
gitlink_path
);
wt
->
gitlink_path
);
err
=
-
1
;
return
GIT_ERROR
;
goto
out
;
}
}
if
(
wt
->
parent_path
&&
!
git_path_exists
(
wt
->
parent_path
))
{
if
(
wt
->
parent_path
&&
!
git_path_exists
(
wt
->
parent_path
))
{
giterr_set
(
GITERR_WORKTREE
,
giterr_set
(
GITERR_WORKTREE
,
"Worktree parent directory ('%s') does not exist "
,
"Worktree parent directory ('%s') does not exist "
,
wt
->
parent_path
);
wt
->
parent_path
);
err
=
-
2
;
return
GIT_ERROR
;
goto
out
;
}
}
if
(
!
git_path_exists
(
wt
->
commondir_path
))
{
if
(
!
git_path_exists
(
wt
->
commondir_path
))
{
giterr_set
(
GITERR_WORKTREE
,
giterr_set
(
GITERR_WORKTREE
,
"Worktree common directory ('%s') does not exist "
,
"Worktree common directory ('%s') does not exist "
,
wt
->
commondir_path
);
wt
->
commondir_path
);
err
=
-
3
;
return
GIT_ERROR
;
goto
out
;
}
}
out:
return
0
;
return
err
;
}
}
int
git_worktree_add_init_options
(
git_worktree_add_options
*
opts
,
int
git_worktree_add_init_options
(
git_worktree_add_options
*
opts
,
...
...
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