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
266f26ed
Commit
266f26ed
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkout: use GIT_ASSERT
parent
e0f3c33d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
src/checkout.c
+10
-7
No files found.
src/checkout.c
View file @
266f26ed
...
...
@@ -1243,7 +1243,7 @@ static int checkout_conflict_append_remove(
checkout_data
*
data
=
payload
;
const
char
*
name
;
assert
(
ancestor
||
ours
||
theirs
);
GIT_ASSERT_ARG
(
ancestor
||
ours
||
theirs
);
if
(
ancestor
)
name
=
git__strdup
(
ancestor
->
path
);
...
...
@@ -1487,7 +1487,9 @@ static int checkout_stream_write(
static
int
checkout_stream_close
(
git_writestream
*
s
)
{
struct
checkout_stream
*
stream
=
(
struct
checkout_stream
*
)
s
;
assert
(
stream
&&
stream
->
open
);
GIT_ASSERT_ARG
(
stream
);
GIT_ASSERT_ARG
(
stream
->
open
);
stream
->
open
=
0
;
return
p_close
(
stream
->
fd
);
...
...
@@ -1554,7 +1556,7 @@ static int blob_content_to_file(
error
=
git_filter_list_stream_blob
(
fl
,
blob
,
&
writer
.
base
);
assert
(
writer
.
open
==
0
);
GIT_ASSERT
(
writer
.
open
==
0
);
git_filter_list_free
(
fl
);
...
...
@@ -1976,7 +1978,7 @@ static int checkout_write_entry(
struct
stat
st
;
int
error
;
assert
(
side
==
conflict
->
ours
||
side
==
conflict
->
theirs
);
GIT_ASSERT
(
side
==
conflict
->
ours
||
side
==
conflict
->
theirs
);
if
(
checkout_target_fullpath
(
&
fullpath
,
data
,
side
->
path
)
<
0
)
return
-
1
;
...
...
@@ -2588,7 +2590,7 @@ int git_checkout_iterator(
}
/* Should not have case insensitivity mismatch */
assert
(
git_iterator_ignore_case
(
workdir
)
==
git_iterator_ignore_case
(
baseline
));
GIT_ASSERT
(
git_iterator_ignore_case
(
workdir
)
==
git_iterator_ignore_case
(
baseline
));
/* Generate baseline-to-target diff which will include an entry for
* every possible update that might need to be made.
...
...
@@ -2639,7 +2641,7 @@ int git_checkout_iterator(
(
error
=
checkout_extensions_update_index
(
&
data
))
<
0
)
goto
cleanup
;
assert
(
data
.
completed_steps
==
data
.
total_steps
);
GIT_ASSERT
(
data
.
completed_steps
==
data
.
total_steps
);
if
(
data
.
opts
.
perfdata_cb
)
data
.
opts
.
perfdata_cb
(
&
data
.
perfdata
,
data
.
opts
.
perfdata_payload
);
...
...
@@ -2767,7 +2769,8 @@ int git_checkout_head(
git_repository
*
repo
,
const
git_checkout_options
*
opts
)
{
assert
(
repo
);
GIT_ASSERT_ARG
(
repo
);
return
git_checkout_tree
(
repo
,
NULL
,
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