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
f6f48f90
Commit
f6f48f90
authored
May 01, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify error reporting
parent
3e199f42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
13 deletions
+4
-13
src/clone.c
+4
-13
No files found.
src/clone.c
View file @
f6f48f90
...
...
@@ -387,18 +387,6 @@ static int setup_remotes_and_fetch(
}
static
bool
path_is_okay
(
const
char
*
path
)
{
/* The path must either not exist, or be an empty directory */
if
(
!
git_path_exists
(
path
))
return
true
;
if
(
!
git_path_is_empty_dir
(
path
))
{
giterr_set
(
GITERR_INVALID
,
"'%s' exists and is not an empty directory"
,
path
);
return
false
;
}
return
true
;
}
static
bool
should_checkout
(
git_repository
*
repo
,
bool
is_bare
,
...
...
@@ -444,7 +432,10 @@ int git_clone(
normalize_options
(
&
normOptions
,
options
);
GITERR_CHECK_VERSION
(
&
normOptions
,
GIT_CLONE_OPTIONS_VERSION
,
"git_clone_options"
);
if
(
!
path_is_okay
(
local_path
))
{
/* Only clone to a new directory or an empty directory */
if
(
git_path_exists
(
local_path
)
&&
!
git_path_is_empty_dir
(
local_path
))
{
giterr_set
(
GITERR_INVALID
,
"'%s' exists and is not an empty directory"
,
path
);
return
GIT_ERROR
;
}
...
...
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