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
f58cc280
Commit
f58cc280
authored
Feb 03, 2015
by
Edward Thomson
Committed by
Edward Thomson
Feb 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attr_session: keep a temp buffer
parent
d4b1b767
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
3 deletions
+9
-3
src/attr_file.c
+1
-0
src/attr_file.h
+1
-0
src/attrcache.c
+7
-3
No files found.
src/attr_file.c
View file @
f58cc280
...
...
@@ -861,6 +861,7 @@ void git_attr_session__free(git_attr_session *session)
return
;
git_buf_free
(
&
session
->
sysdir
);
git_buf_free
(
&
session
->
tmp
);
memset
(
session
,
0
,
sizeof
(
git_attr_session
));
}
src/attr_file.h
View file @
f58cc280
...
...
@@ -114,6 +114,7 @@ typedef struct {
unsigned
int
init_setup
:
1
,
init_sysdir
:
1
;
git_buf
sysdir
;
git_buf
tmp
;
}
git_attr_session
;
extern
int
git_attr_session__init
(
git_attr_session
*
attr_session
,
git_repository
*
repo
);
...
...
src/attrcache.c
View file @
f58cc280
...
...
@@ -149,6 +149,7 @@ static int attr_cache_lookup(
git_attr_file
**
out_file
,
git_attr_file_entry
**
out_entry
,
git_repository
*
repo
,
git_attr_session
*
attr_session
,
git_attr_file_source
source
,
const
char
*
base
,
const
char
*
filename
)
...
...
@@ -162,9 +163,12 @@ static int attr_cache_lookup(
/* join base and path as needed */
if
(
base
!=
NULL
&&
git_path_root
(
filename
)
<
0
)
{
if
(
git_buf_joinpath
(
&
path
,
base
,
filename
)
<
0
)
git_buf
*
p
=
attr_session
?
&
attr_session
->
tmp
:
&
path
;
if
(
git_buf_joinpath
(
p
,
base
,
filename
)
<
0
)
return
-
1
;
filename
=
path
.
ptr
;
filename
=
p
->
ptr
;
}
relfile
=
filename
;
...
...
@@ -208,7 +212,7 @@ int git_attr_cache__get(
git_attr_file
*
file
=
NULL
,
*
updated
=
NULL
;
if
((
error
=
attr_cache_lookup
(
&
file
,
&
entry
,
repo
,
source
,
base
,
filename
))
<
0
)
&
file
,
&
entry
,
repo
,
attr_session
,
source
,
base
,
filename
))
<
0
)
return
error
;
/* load file if we don't have one or if existing one is out of date */
...
...
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