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
82d7a114
Unverified
Commit
82d7a114
authored
Nov 05, 2019
by
Patrick Steinhardt
Committed by
GitHub
Nov 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5293 from csware/config_snapshot-snapshot
Fix crash if snapshotting a config_snapshot
parents
45c8d3f4
dadbb33b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
src/config_snapshot.c
+1
-0
tests/config/snapshot.c
+20
-0
No files found.
src/config_snapshot.c
View file @
82d7a114
...
...
@@ -192,6 +192,7 @@ int git_config_backend_snapshot(git_config_backend **out, git_config_backend *so
backend
->
parent
.
get
=
config_get_readonly
;
backend
->
parent
.
set
=
config_set_readonly
;
backend
->
parent
.
set_multivar
=
config_set_multivar_readonly
;
backend
->
parent
.
snapshot
=
git_config_backend_snapshot
;
backend
->
parent
.
del
=
config_delete_readonly
;
backend
->
parent
.
del_multivar
=
config_delete_multivar_readonly
;
backend
->
parent
.
iterator
=
config_iterator_new_readonly
;
...
...
tests/config/snapshot.c
View file @
82d7a114
...
...
@@ -100,3 +100,23 @@ void test_config_snapshot__includes(void)
cl_git_pass
(
p_unlink
(
"including"
));
cl_git_pass
(
p_unlink
(
"included"
));
}
void
test_config_snapshot__snapshot
(
void
)
{
git_config
*
snapshot_snapshot
;
int
i
;
cl_git_mkfile
(
"configfile"
,
"[section]
\n
key = 1
\n
"
);
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
"configfile"
));
cl_git_pass
(
git_config_snapshot
(
&
snapshot
,
cfg
));
cl_git_pass
(
git_config_snapshot
(
&
snapshot_snapshot
,
snapshot
));
cl_git_pass
(
git_config_get_int32
(
&
i
,
snapshot_snapshot
,
"section.key"
));
cl_assert_equal_i
(
i
,
1
);
git_config_free
(
snapshot_snapshot
);
cl_git_pass
(
p_unlink
(
"configfile"
));
}
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