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
8005c6d4
Commit
8005c6d4
authored
Feb 26, 2013
by
Michael Schubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "hash: remove git_hash_init from internal api"
This reverts commit
efe7fad6
, except for the indentation fixes.
parent
f657688b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
4 deletions
+6
-4
src/hash.h
+1
-0
src/hash/hash_generic.c
+1
-1
src/hash/hash_generic.h
+1
-0
src/hash/hash_win32.c
+2
-2
tests-clar/object/raw/hash.c
+1
-1
No files found.
src/hash.h
View file @
8005c6d4
...
@@ -31,6 +31,7 @@ typedef struct {
...
@@ -31,6 +31,7 @@ typedef struct {
size_t
len
;
size_t
len
;
}
git_buf_vec
;
}
git_buf_vec
;
int
git_hash_init
(
git_hash_ctx
*
c
);
int
git_hash_update
(
git_hash_ctx
*
c
,
const
void
*
data
,
size_t
len
);
int
git_hash_update
(
git_hash_ctx
*
c
,
const
void
*
data
,
size_t
len
);
int
git_hash_final
(
git_oid
*
out
,
git_hash_ctx
*
c
);
int
git_hash_final
(
git_oid
*
out
,
git_hash_ctx
*
c
);
...
...
src/hash/hash_generic.c
View file @
8005c6d4
...
@@ -221,7 +221,7 @@ static void hash__block(git_hash_ctx *ctx, const unsigned int *data)
...
@@ -221,7 +221,7 @@ static void hash__block(git_hash_ctx *ctx, const unsigned int *data)
ctx
->
H
[
4
]
+=
E
;
ctx
->
H
[
4
]
+=
E
;
}
}
int
git_hash_
ctx_
init
(
git_hash_ctx
*
ctx
)
int
git_hash_init
(
git_hash_ctx
*
ctx
)
{
{
ctx
->
size
=
0
;
ctx
->
size
=
0
;
...
...
src/hash/hash_generic.h
View file @
8005c6d4
...
@@ -18,6 +18,7 @@ struct git_hash_ctx {
...
@@ -18,6 +18,7 @@ struct git_hash_ctx {
#define git_hash_global_init() 0
#define git_hash_global_init() 0
#define git_hash_global_shutdown()
/* noop */
#define git_hash_global_shutdown()
/* noop */
#define git_hash_ctx_init(ctx) git_hash_init(ctx)
#define git_hash_ctx_cleanup(ctx)
#define git_hash_ctx_cleanup(ctx)
#endif
/* INCLUDE_hash_generic_h__ */
#endif
/* INCLUDE_hash_generic_h__ */
src/hash/hash_win32.c
View file @
8005c6d4
...
@@ -134,7 +134,7 @@ GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)
...
@@ -134,7 +134,7 @@ GIT_INLINE(int) hash_ctx_cryptoapi_init(git_hash_ctx *ctx)
ctx
->
type
=
CRYPTOAPI
;
ctx
->
type
=
CRYPTOAPI
;
ctx
->
prov
=
&
hash_prov
;
ctx
->
prov
=
&
hash_prov
;
return
git_hash_
ctx_
init
(
ctx
);
return
git_hash_init
(
ctx
);
}
}
GIT_INLINE
(
int
)
hash_cryptoapi_init
(
git_hash_ctx
*
ctx
)
GIT_INLINE
(
int
)
hash_cryptoapi_init
(
git_hash_ctx
*
ctx
)
...
@@ -262,7 +262,7 @@ int git_hash_ctx_init(git_hash_ctx *ctx)
...
@@ -262,7 +262,7 @@ int git_hash_ctx_init(git_hash_ctx *ctx)
return
(
hash_prov
.
type
==
CNG
)
?
hash_ctx_cng_init
(
ctx
)
:
hash_ctx_cryptoapi_init
(
ctx
);
return
(
hash_prov
.
type
==
CNG
)
?
hash_ctx_cng_init
(
ctx
)
:
hash_ctx_cryptoapi_init
(
ctx
);
}
}
int
git_hash_
ctx_
init
(
git_hash_ctx
*
ctx
)
int
git_hash_init
(
git_hash_ctx
*
ctx
)
{
{
assert
(
ctx
&&
ctx
->
type
);
assert
(
ctx
&&
ctx
->
type
);
return
(
ctx
->
type
==
CNG
)
?
hash_cng_init
(
ctx
)
:
hash_cryptoapi_init
(
ctx
);
return
(
ctx
->
type
==
CNG
)
?
hash_cng_init
(
ctx
)
:
hash_cryptoapi_init
(
ctx
);
...
...
tests-clar/object/raw/hash.c
View file @
8005c6d4
...
@@ -35,7 +35,7 @@ void test_object_raw_hash__hash_by_blocks(void)
...
@@ -35,7 +35,7 @@ void test_object_raw_hash__hash_by_blocks(void)
cl_assert
(
git_oid_cmp
(
&
id1
,
&
id2
)
==
0
);
cl_assert
(
git_oid_cmp
(
&
id1
,
&
id2
)
==
0
);
/* reinit should permit reuse */
/* reinit should permit reuse */
cl_git_pass
(
git_hash_
ctx_
init
(
&
ctx
));
cl_git_pass
(
git_hash_init
(
&
ctx
));
cl_git_pass
(
git_hash_update
(
&
ctx
,
bye_text
,
strlen
(
bye_text
)));
cl_git_pass
(
git_hash_update
(
&
ctx
,
bye_text
,
strlen
(
bye_text
)));
cl_git_pass
(
git_hash_final
(
&
id2
,
&
ctx
));
cl_git_pass
(
git_hash_final
(
&
id2
,
&
ctx
));
cl_git_pass
(
git_oid_fromstr
(
&
id1
,
bye_id
));
cl_git_pass
(
git_oid_fromstr
(
&
id1
,
bye_id
));
...
...
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