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
9f57fd64
Commit
9f57fd64
authored
Oct 01, 2014
by
Vicent Marti
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2594 from libgit2/vmg/hashsig
hashsig: Export as a `sys` header
parents
5451754d
737b5051
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
12 deletions
+16
-12
include/git2/sys/hashsig.h
+11
-7
src/diff_tform.c
+1
-1
src/hashsig.c
+1
-1
src/merge.c
+1
-1
tests/core/buffer.c
+1
-1
tests/merge/trees/treediff.c
+1
-1
No files found.
src
/hashsig.h
→
include/git2/sys
/hashsig.h
View file @
9f57fd64
...
...
@@ -4,10 +4,12 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_hashsig_h__
#define INCLUDE_hashsig_h__
#ifndef INCLUDE_
sys_
hashsig_h__
#define INCLUDE_
sys_
hashsig_h__
#include "common.h"
#include "git2/common.h"
GIT_BEGIN_DECL
/**
* Similarity signature of line hashes for a buffer
...
...
@@ -35,7 +37,7 @@ typedef enum {
* @param buflen The length of the data at `buf`
* @param generate_pairwise_hashes Should pairwise runs be hashed
*/
extern
int
git_hashsig_create
(
GIT_EXTERN
(
int
)
git_hashsig_create
(
git_hashsig
**
out
,
const
char
*
buf
,
size_t
buflen
,
...
...
@@ -50,7 +52,7 @@ extern int git_hashsig_create(
* This will return an error if the file doesn't contain enough data to
* compute a valid signature.
*/
extern
int
git_hashsig_create_fromfile
(
GIT_EXTERN
(
int
)
git_hashsig_create_fromfile
(
git_hashsig
**
out
,
const
char
*
path
,
git_hashsig_option_t
opts
);
...
...
@@ -58,15 +60,17 @@ extern int git_hashsig_create_fromfile(
/**
* Release memory for a content similarity signature
*/
extern
void
git_hashsig_free
(
git_hashsig
*
sig
);
GIT_EXTERN
(
void
)
git_hashsig_free
(
git_hashsig
*
sig
);
/**
* Measure similarity between two files
*
* @return <0 for error, [0 to 100] as similarity score
*/
extern
int
git_hashsig_compare
(
GIT_EXTERN
(
int
)
git_hashsig_compare
(
const
git_hashsig
*
a
,
const
git_hashsig
*
b
);
GIT_END_DECL
#endif
src/diff_tform.c
View file @
9f57fd64
...
...
@@ -8,9 +8,9 @@
#include "git2/config.h"
#include "git2/blob.h"
#include "git2/sys/hashsig.h"
#include "diff.h"
#include "hashsig.h"
#include "path.h"
#include "fileops.h"
#include "config.h"
...
...
src/hashsig.c
View file @
9f57fd64
...
...
@@ -4,7 +4,7 @@
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "hashsig.h"
#include "
git2/sys/
hashsig.h"
#include "fileops.h"
#include "util.h"
...
...
src/merge.c
View file @
9f57fd64
...
...
@@ -22,7 +22,6 @@
#include "tree.h"
#include "merge_file.h"
#include "blob.h"
#include "hashsig.h"
#include "oid.h"
#include "index.h"
#include "filebuf.h"
...
...
@@ -42,6 +41,7 @@
#include "git2/tree.h"
#include "git2/oidarray.h"
#include "git2/sys/index.h"
#include "git2/sys/hashsig.h"
#define GIT_MERGE_INDEX_ENTRY_EXISTS(X) ((X).mode != 0)
#define GIT_MERGE_INDEX_ENTRY_ISFILE(X) S_ISREG((X).mode)
...
...
tests/core/buffer.c
View file @
9f57fd64
#include "clar_libgit2.h"
#include "buffer.h"
#include "buf_text.h"
#include "hashsig.h"
#include "
git2/sys/
hashsig.h"
#include "fileops.h"
#define TESTSTR "Have you seen that? Have you seeeen that??"
...
...
tests/merge/trees/treediff.c
View file @
9f57fd64
...
...
@@ -3,7 +3,7 @@
#include "merge.h"
#include "../merge_helpers.h"
#include "diff.h"
#include "hashsig.h"
#include "
git2/sys/
hashsig.h"
static
git_repository
*
repo
;
...
...
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