Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-02-19 22:25:41 +0400
committerRussell Belfer <rb@github.com>2013-02-21 03:09:41 +0400
commit9bc8be3d7e5134de1d912c7ef08d6207079bd8c1 (patch)
treef4840ab516ccee1ce427201624b2deaff3d81c7b /src/hashsig.c
parenta235e9d355c2188eb35efeac8147b2e8b626caa3 (diff)
Refine pluggable similarity API
This plugs in the three basic similarity strategies for handling whitespace via internal use of the pluggable API. In so doing, I realized that the use of git_buf in the hashsig API was not needed and actually just made it harder to use, so I tweaked that API as well. Note that the similarity metric is still not hooked up in the find_similarity code - this is just setting out the function that will be used.
Diffstat (limited to 'src/hashsig.c')
-rw-r--r--src/hashsig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hashsig.c b/src/hashsig.c
index a9cd8fa53..60649fd11 100644
--- a/src/hashsig.c
+++ b/src/hashsig.c
@@ -266,7 +266,8 @@ static git_hashsig *hashsig_alloc(git_hashsig_option_t opts)
int git_hashsig_create(
git_hashsig **out,
- const git_buf *buf,
+ const char *buf,
+ size_t buflen,
git_hashsig_option_t opts)
{
int error;
@@ -274,7 +275,7 @@ int git_hashsig_create(
git_hashsig *sig = hashsig_alloc(opts);
GITERR_CHECK_ALLOC(sig);
- error = hashsig_add_hashes(sig, buf->ptr, buf->size, &prog);
+ error = hashsig_add_hashes(sig, buf, buflen, &prog);
if (!error)
error = hashsig_finalize_hashes(sig);