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
d4384977
Commit
d4384977
authored
4 years ago
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clone: use GIT_ASSERT
parent
5d8b75fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/clone.c
+10
-5
No files found.
src/clone.c
View file @
d4384977
...
@@ -231,7 +231,7 @@ static int update_head_to_remote(
...
@@ -231,7 +231,7 @@ static int update_head_to_remote(
/* We know we have HEAD, let's see where it points */
/* We know we have HEAD, let's see where it points */
remote_head
=
refs
[
0
];
remote_head
=
refs
[
0
];
assert
(
remote_head
);
GIT_ASSERT
(
remote_head
);
remote_head_id
=
&
remote_head
->
oid
;
remote_head_id
=
&
remote_head
->
oid
;
...
@@ -267,7 +267,8 @@ static int update_head_to_branch(
...
@@ -267,7 +267,8 @@ static int update_head_to_branch(
git_buf
remote_branch_name
=
GIT_BUF_INIT
;
git_buf
remote_branch_name
=
GIT_BUF_INIT
;
git_reference
*
remote_ref
=
NULL
;
git_reference
*
remote_ref
=
NULL
;
assert
(
remote_name
&&
branch
);
GIT_ASSERT_ARG
(
remote_name
);
GIT_ASSERT_ARG
(
branch
);
if
((
retcode
=
git_buf_printf
(
&
remote_branch_name
,
GIT_REFS_REMOTES_DIR
"%s/%s"
,
if
((
retcode
=
git_buf_printf
(
&
remote_branch_name
,
GIT_REFS_REMOTES_DIR
"%s/%s"
,
remote_name
,
branch
))
<
0
)
remote_name
,
branch
))
<
0
)
...
@@ -385,7 +386,8 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
...
@@ -385,7 +386,8 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
git_fetch_options
fetch_opts
;
git_fetch_options
fetch_opts
;
git_remote
*
remote
;
git_remote
*
remote
;
assert
(
repo
&&
_remote
);
GIT_ASSERT_ARG
(
repo
);
GIT_ASSERT_ARG
(
_remote
);
if
(
!
git_repository_is_empty
(
repo
))
{
if
(
!
git_repository_is_empty
(
repo
))
{
git_error_set
(
GIT_ERROR_INVALID
,
"the repository is not empty"
);
git_error_set
(
GIT_ERROR_INVALID
,
"the repository is not empty"
);
...
@@ -452,7 +454,9 @@ static int git__clone(
...
@@ -452,7 +454,9 @@ static int git__clone(
uint32_t
rmdir_flags
=
GIT_RMDIR_REMOVE_FILES
;
uint32_t
rmdir_flags
=
GIT_RMDIR_REMOVE_FILES
;
git_repository_create_cb
repository_cb
;
git_repository_create_cb
repository_cb
;
assert
(
out
&&
url
&&
local_path
);
GIT_ASSERT_ARG
(
out
);
GIT_ASSERT_ARG
(
url
);
GIT_ASSERT_ARG
(
local_path
);
if
(
_options
)
if
(
_options
)
memcpy
(
&
options
,
_options
,
sizeof
(
git_clone_options
));
memcpy
(
&
options
,
_options
,
sizeof
(
git_clone_options
));
...
@@ -575,7 +579,8 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
...
@@ -575,7 +579,8 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
git_buf
src_odb
=
GIT_BUF_INIT
,
dst_odb
=
GIT_BUF_INIT
,
src_path
=
GIT_BUF_INIT
;
git_buf
src_odb
=
GIT_BUF_INIT
,
dst_odb
=
GIT_BUF_INIT
,
src_path
=
GIT_BUF_INIT
;
git_buf
reflog_message
=
GIT_BUF_INIT
;
git_buf
reflog_message
=
GIT_BUF_INIT
;
assert
(
repo
&&
remote
);
GIT_ASSERT_ARG
(
repo
);
GIT_ASSERT_ARG
(
remote
);
if
(
!
git_repository_is_empty
(
repo
))
{
if
(
!
git_repository_is_empty
(
repo
))
{
git_error_set
(
GIT_ERROR_INVALID
,
"the repository is not empty"
);
git_error_set
(
GIT_ERROR_INVALID
,
"the repository is not empty"
);
...
...
This diff is collapsed.
Click to expand it.
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