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
788430c8
Commit
788430c8
authored
Mar 01, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter: Properly cache filter settings
parent
c5266eba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
src/filter.c
+8
-2
src/repository.h
+1
-0
No files found.
src/filter.c
View file @
788430c8
...
...
@@ -87,9 +87,11 @@ int git_text__is_binary(git_text_stats *stats)
int
git_filter__load_for_file
(
git_vector
*
filters
,
git_repository
*
repo
,
const
char
*
path
,
int
mode
)
{
int
error
;
git_filter
*
crlf_filter
;
git_filter
*
crlf_filter
=
NULL
;
return
0
;
/* TODO: not quite ready yet */
error
=
git_filter__load_settings
(
repo
);
if
(
error
<
GIT_SUCCESS
)
return
error
;
if
(
mode
==
GIT_FILTER_TO_ODB
)
{
error
=
git_filter__crlf_to_odb
(
&
crlf_filter
,
repo
,
path
);
...
...
@@ -183,6 +185,9 @@ int git_filter__load_settings(git_repository *repo)
git_config
*
config
;
int
error
;
if
(
repo
->
filter_options
.
loaded
)
return
GIT_SUCCESS
;
repo
->
filter_options
.
eol
=
GIT_EOL_DEFAULT
;
repo
->
filter_options
.
auto_crlf
=
GIT_AUTO_CRLF_DEFAULT
;
...
...
@@ -202,5 +207,6 @@ int git_filter__load_settings(git_repository *repo)
if
(
error
<
GIT_SUCCESS
&&
error
!=
GIT_ENOTFOUND
)
return
error
;
repo
->
filter_options
.
loaded
=
1
;
return
0
;
}
src/repository.h
View file @
788430c8
...
...
@@ -48,6 +48,7 @@ struct git_repository {
unsigned
int
lru_counter
;
struct
{
int
loaded
;
int
eol
;
int
auto_crlf
;
}
filter_options
;
...
...
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