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
99ba8f23
Commit
99ba8f23
authored
Jan 22, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip: adding metric to diff
parent
f3327cac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/diff_tform.c
+8
-2
No files found.
src/diff_tform.c
View file @
99ba8f23
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
#include "common.h"
#include "common.h"
#include "diff.h"
#include "diff.h"
#include "git2/config.h"
#include "git2/config.h"
#include "buf_text.h"
static
git_diff_delta
*
diff_delta__dup
(
static
git_diff_delta
*
diff_delta__dup
(
const
git_diff_delta
*
d
,
git_pool
*
pool
)
const
git_diff_delta
*
d
,
git_pool
*
pool
)
...
@@ -297,10 +298,15 @@ on_error:
...
@@ -297,10 +298,15 @@ on_error:
return
-
1
;
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
(
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
)
if
(
git_oid_cmp
(
&
old_file
->
oid
,
&
new_file
->
oid
)
==
0
)
return
100
;
return
100
;
...
...
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