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
b1914c36
Commit
b1914c36
authored
May 12, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor fixes for warnings and error propagation
parent
7bcced44
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
12 deletions
+14
-12
include/git2/repository.h
+5
-1
src/config_file.c
+5
-8
src/diff_driver.c
+1
-1
src/repository.c
+3
-2
No files found.
include/git2/repository.h
View file @
b1914c36
...
...
@@ -418,7 +418,11 @@ GIT_EXTERN(int) git_repository_config(git_config **out, git_repository *repo);
* Get a snapshot of the repository's configuration
*
* Convenience function to take a snapshot from the repository's
* configuration.
* configuration. The contents of this snapshot will not change,
* even if the underlying config files are modified.
*
* The configuration file must be freed once it's no longer
* being used by the user.
*
* @param out Pointer to store the loaded configuration
* @param repo the repository
...
...
src/config_file.c
View file @
b1914c36
...
...
@@ -247,18 +247,15 @@ static int refcounted_strmap_alloc(refcounted_strmap **out)
int
error
;
map
=
git__calloc
(
1
,
sizeof
(
refcounted_strmap
));
if
(
!
map
)
{
giterr_set_oom
();
return
-
1
;
}
GITERR_CHECK_ALLOC
(
map
);
git_atomic_set
(
&
map
->
refcount
,
1
);
if
((
error
=
git_strmap_alloc
(
&
map
->
values
))
<
0
)
{
git__free
(
map
);
return
error
;
}
if
((
error
=
git_strmap_alloc
(
&
map
->
values
))
<
0
)
git__free
(
map
);
else
*
out
=
map
;
return
error
;
}
...
...
src/diff_driver.c
View file @
b1914c36
...
...
@@ -219,7 +219,7 @@ static int git_diff_driver_load(
git_diff_driver
*
drv
=
NULL
;
size_t
namelen
=
strlen
(
driver_name
);
khiter_t
pos
;
git_config
*
cfg
,
*
repo_cfg
;
git_config
*
cfg
;
git_buf
name
=
GIT_BUF_INIT
;
const
git_config_entry
*
ce
;
bool
found_driver
=
false
;
...
...
src/repository.c
View file @
b1914c36
...
...
@@ -627,10 +627,11 @@ int git_repository_config(git_config **out, git_repository *repo)
int
git_repository_config_snapshot
(
git_config
**
out
,
git_repository
*
repo
)
{
int
error
;
git_config
*
weak
;
if
(
git_repository_config__weakptr
(
&
weak
,
repo
)
<
0
)
return
-
1
;
if
(
(
error
=
git_repository_config__weakptr
(
&
weak
,
repo
)
)
<
0
)
return
error
;
return
git_config_snapshot
(
out
,
weak
);
}
...
...
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