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
d42e4d5f
Commit
d42e4d5f
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transaction: use GIT_ASSERT
parent
9083a0e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
8 deletions
+19
-8
src/transaction.c
+19
-8
No files found.
src/transaction.c
View file @
d42e4d5f
...
...
@@ -57,7 +57,9 @@ struct git_transaction {
int
git_transaction_config_new
(
git_transaction
**
out
,
git_config
*
cfg
)
{
git_transaction
*
tx
;
assert
(
out
&&
cfg
);
GIT_ASSERT_ARG
(
out
);
GIT_ASSERT_ARG
(
cfg
);
tx
=
git__calloc
(
1
,
sizeof
(
git_transaction
));
GIT_ERROR_CHECK_ALLOC
(
tx
);
...
...
@@ -74,7 +76,8 @@ int git_transaction_new(git_transaction **out, git_repository *repo)
git_pool
pool
;
git_transaction
*
tx
=
NULL
;
assert
(
out
&&
repo
);
GIT_ASSERT_ARG
(
out
);
GIT_ASSERT_ARG
(
repo
);
if
((
error
=
git_pool_init
(
&
pool
,
1
))
<
0
)
goto
on_error
;
...
...
@@ -109,7 +112,8 @@ int git_transaction_lock_ref(git_transaction *tx, const char *refname)
int
error
;
transaction_node
*
node
;
assert
(
tx
&&
refname
);
GIT_ASSERT_ARG
(
tx
);
GIT_ASSERT_ARG
(
refname
);
node
=
git_pool_mallocz
(
&
tx
->
pool
,
sizeof
(
transaction_node
));
GIT_ERROR_CHECK_ALLOC
(
node
);
...
...
@@ -176,7 +180,9 @@ int git_transaction_set_target(git_transaction *tx, const char *refname, const g
int
error
;
transaction_node
*
node
;
assert
(
tx
&&
refname
&&
target
);
GIT_ASSERT_ARG
(
tx
);
GIT_ASSERT_ARG
(
refname
);
GIT_ASSERT_ARG
(
target
);
if
((
error
=
find_locked
(
&
node
,
tx
,
refname
))
<
0
)
return
error
;
...
...
@@ -195,7 +201,9 @@ int git_transaction_set_symbolic_target(git_transaction *tx, const char *refname
int
error
;
transaction_node
*
node
;
assert
(
tx
&&
refname
&&
target
);
GIT_ASSERT_ARG
(
tx
);
GIT_ASSERT_ARG
(
refname
);
GIT_ASSERT_ARG
(
target
);
if
((
error
=
find_locked
(
&
node
,
tx
,
refname
))
<
0
)
return
error
;
...
...
@@ -272,7 +280,9 @@ int git_transaction_set_reflog(git_transaction *tx, const char *refname, const g
int
error
;
transaction_node
*
node
;
assert
(
tx
&&
refname
&&
reflog
);
GIT_ASSERT_ARG
(
tx
);
GIT_ASSERT_ARG
(
refname
);
GIT_ASSERT_ARG
(
reflog
);
if
((
error
=
find_locked
(
&
node
,
tx
,
refname
))
<
0
)
return
error
;
...
...
@@ -320,7 +330,7 @@ int git_transaction_commit(git_transaction *tx)
transaction_node
*
node
;
int
error
=
0
;
assert
(
tx
);
GIT_ASSERT_ARG
(
tx
);
if
(
tx
->
type
==
TRANSACTION_CONFIG
)
{
error
=
git_config_unlock
(
tx
->
cfg
,
true
);
...
...
@@ -355,7 +365,8 @@ void git_transaction_free(git_transaction *tx)
transaction_node
*
node
;
git_pool
pool
;
assert
(
tx
);
if
(
!
tx
)
return
;
if
(
tx
->
type
==
TRANSACTION_CONFIG
)
{
if
(
tx
->
cfg
)
{
...
...
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