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
fa1a4c77
Commit
fa1a4c77
authored
Jul 21, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blob: deprecate `git_blob_filtered_content`
Users should now use `git_blob_filter`.
parent
a008ceea
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
35 deletions
+23
-35
include/git2/blob.h
+0
-19
include/git2/deprecated.h
+7
-0
src/blob.c
+16
-16
No files found.
include/git2/blob.h
View file @
fa1a4c77
...
...
@@ -146,25 +146,6 @@ GIT_EXTERN(int) git_blob_filter(
git_blob_filter_options
*
opts
);
/**
* Get a buffer with the filtered content of a blob. This is
* equivalent to calling `git_blob_filter`, with the only possible
* option being the binary check.
*
* @see git_blob_filter
* @param out The git_buf to be filled in
* @param blob Pointer to the blob
* @param as_path Path used for file attribute lookups, etc.
* @param check_for_binary_data Should this test if blob content contains
* NUL bytes / looks like binary data before applying filters?
* @return 0 on success or an error code
*/
GIT_EXTERN
(
int
)
git_blob_filtered_content
(
git_buf
*
out
,
git_blob
*
blob
,
const
char
*
as_path
,
int
check_for_binary_data
);
/**
* Read a file from the working folder of a repository
* and write it to the Object Database as a loose blob
*
...
...
include/git2/deprecated.h
View file @
fa1a4c77
...
...
@@ -90,6 +90,13 @@ GIT_EXTERN(int) git_blob_create_fromstream_commit(
GIT_EXTERN
(
int
)
git_blob_create_frombuffer
(
git_oid
*
id
,
git_repository
*
repo
,
const
void
*
buffer
,
size_t
len
);
/** Deprecated in favor of @see git_blob_filter */
GIT_EXTERN
(
int
)
git_blob_filtered_content
(
git_buf
*
out
,
git_blob
*
blob
,
const
char
*
as_path
,
int
check_for_binary_data
);
/**@}*/
/** @name Deprecated Buffer Functions
...
...
src/blob.c
View file @
fa1a4c77
...
...
@@ -437,22 +437,6 @@ int git_blob_filter(
return
error
;
}
int
git_blob_filtered_content
(
git_buf
*
out
,
git_blob
*
blob
,
const
char
*
path
,
int
check_for_binary_data
)
{
git_blob_filter_options
opts
=
GIT_BLOB_FILTER_OPTIONS_INIT
;
if
(
check_for_binary_data
)
opts
.
flags
|=
GIT_BLOB_FILTER_CHECK_FOR_BINARY
;
else
opts
.
flags
&=
~
GIT_BLOB_FILTER_CHECK_FOR_BINARY
;
return
git_blob_filter
(
out
,
blob
,
path
,
&
opts
);
}
/* Deprecated functions */
int
git_blob_create_frombuffer
(
...
...
@@ -485,3 +469,19 @@ int git_blob_create_fromstream_commit(
{
return
git_blob_create_from_stream_commit
(
out
,
stream
);
}
int
git_blob_filtered_content
(
git_buf
*
out
,
git_blob
*
blob
,
const
char
*
path
,
int
check_for_binary_data
)
{
git_blob_filter_options
opts
=
GIT_BLOB_FILTER_OPTIONS_INIT
;
if
(
check_for_binary_data
)
opts
.
flags
|=
GIT_BLOB_FILTER_CHECK_FOR_BINARY
;
else
opts
.
flags
&=
~
GIT_BLOB_FILTER_CHECK_FOR_BINARY
;
return
git_blob_filter
(
out
,
blob
,
path
,
&
opts
);
}
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