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-01-23 03:27:08 +0400
committerRussell Belfer <rb@github.com>2013-02-21 03:09:40 +0400
commit99ba8f2322eaa2df51ace9782b8eadc8c5a6e8b8 (patch)
tree2739f3376c2d1fc38eaad7dfd29f946a61098734 /src/diff_tform.c
parentf3327cac1d5cc47d37eb79eb4235f40e447f3ef9 (diff)
wip: adding metric to diff
Diffstat (limited to 'src/diff_tform.c')
-rw-r--r--src/diff_tform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c
index 2c2e1fb19..dbcdc277f 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -7,6 +7,7 @@
#include "common.h"
#include "diff.h"
#include "git2/config.h"
+#include "buf_text.h"
static git_diff_delta *diff_delta__dup(
const git_diff_delta *d, git_pool *pool)
@@ -297,10 +298,15 @@ on_error:
return -1;
}
+typedef struct {
+ /* array of delta index * 2 + (old_file/new_file) -> file hashes */
+ git_buf_text_hashsig *sigs;
+} diff_similarity_cache;
+
static unsigned int calc_similarity(
- void *cache, git_diff_file *old_file, git_diff_file *new_file)
+ void *ref, git_diff_file *old_file, git_diff_file *new_file)
{
- GIT_UNUSED(cache);
+ diff_similarity_cache *cache = ref;
if (git_oid_cmp(&old_file->oid, &new_file->oid) == 0)
return 100;