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
253a873b
Commit
253a873b
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hash: use GIT_ASSERT
parent
03623b47
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
src/hash.c
+5
-8
No files found.
src/hash.c
View file @
253a873b
...
...
@@ -31,7 +31,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
git_hash_sha1_ctx_cleanup
(
&
ctx
->
sha1
);
return
;
default:
assert
(
0
)
;
/* unreachable */
;
}
}
...
...
@@ -41,8 +41,7 @@ int git_hash_init(git_hash_ctx *ctx)
case
GIT_HASH_ALGO_SHA1
:
return
git_hash_sha1_init
(
&
ctx
->
sha1
);
default:
assert
(
0
);
return
-
1
;
GIT_ASSERT
(
0
);
}
}
...
...
@@ -52,8 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
case
GIT_HASH_ALGO_SHA1
:
return
git_hash_sha1_update
(
&
ctx
->
sha1
,
data
,
len
);
default:
assert
(
0
);
return
-
1
;
GIT_ASSERT
(
0
);
}
}
...
...
@@ -63,8 +61,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
case
GIT_HASH_ALGO_SHA1
:
return
git_hash_sha1_final
(
out
,
&
ctx
->
sha1
);
default:
assert
(
0
);
return
-
1
;
GIT_ASSERT
(
0
);
}
}
...
...
@@ -80,7 +77,7 @@ int git_hash_buf(git_oid *out, const void *data, size_t len)
error
=
git_hash_final
(
out
,
&
ctx
);
git_hash_ctx_cleanup
(
&
ctx
);
return
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