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
9562ebcd
Commit
9562ebcd
authored
Sep 13, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3424 from arthurschreiber/arthur/transaction-dont-free-config
Don't free config in `git_transaction_commit`.
parents
1e80bf27
548cb334
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletions
+10
-1
src/transaction.c
+0
-1
tests/config/write.c
+10
-0
No files found.
src/transaction.c
View file @
9562ebcd
...
@@ -331,7 +331,6 @@ int git_transaction_commit(git_transaction *tx)
...
@@ -331,7 +331,6 @@ int git_transaction_commit(git_transaction *tx)
if
(
tx
->
type
==
TRANSACTION_CONFIG
)
{
if
(
tx
->
type
==
TRANSACTION_CONFIG
)
{
error
=
git_config_unlock
(
tx
->
cfg
,
true
);
error
=
git_config_unlock
(
tx
->
cfg
,
true
);
git_config_free
(
tx
->
cfg
);
tx
->
cfg
=
NULL
;
tx
->
cfg
=
NULL
;
return
error
;
return
error
;
...
...
tests/config/write.c
View file @
9562ebcd
...
@@ -670,6 +670,16 @@ void test_config_write__locking(void)
...
@@ -670,6 +670,16 @@ void test_config_write__locking(void)
git_transaction_free
(
tx
);
git_transaction_free
(
tx
);
/* Now that we've unlocked it, we should see both updates */
/* Now that we've unlocked it, we should see both updates */
cl_git_pass
(
git_config_get_entry
(
&
entry
,
cfg
,
"section.name"
));
cl_assert_equal_s
(
"other value"
,
entry
->
value
);
git_config_entry_free
(
entry
);
cl_git_pass
(
git_config_get_entry
(
&
entry
,
cfg
,
"section2.name3"
));
cl_assert_equal_s
(
"more value"
,
entry
->
value
);
git_config_entry_free
(
entry
);
git_config_free
(
cfg
);
/* We should also see the changes after reopening the config */
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
filename
));
cl_git_pass
(
git_config_open_ondisk
(
&
cfg
,
filename
));
cl_git_pass
(
git_config_get_entry
(
&
entry
,
cfg
,
"section.name"
));
cl_git_pass
(
git_config_get_entry
(
&
entry
,
cfg
,
"section.name"
));
cl_assert_equal_s
(
"other value"
,
entry
->
value
);
cl_assert_equal_s
(
"other value"
,
entry
->
value
);
...
...
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