diff options
author | Russell Belfer <rb@github.com> | 2013-02-19 22:25:41 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-02-21 03:09:41 +0400 |
commit | 9bc8be3d7e5134de1d912c7ef08d6207079bd8c1 (patch) | |
tree | f4840ab516ccee1ce427201624b2deaff3d81c7b /src/hashsig.c | |
parent | a235e9d355c2188eb35efeac8147b2e8b626caa3 (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.c | 5 |
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); |