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
677dce8a
Commit
677dce8a
authored
Mar 18, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1080 from carlosmn/config-set-null
Failing config related test
parents
15a63e21
48bde2f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
2 deletions
+21
-2
src/config.c
+5
-0
tests-clar/config/write.c
+14
-0
tests-clar/online/fetchhead.c
+2
-2
No files found.
src/config.c
View file @
677dce8a
...
@@ -362,6 +362,11 @@ int git_config_set_string(git_config *cfg, const char *name, const char *value)
...
@@ -362,6 +362,11 @@ int git_config_set_string(git_config *cfg, const char *name, const char *value)
git_config_backend
*
file
;
git_config_backend
*
file
;
file_internal
*
internal
;
file_internal
*
internal
;
if
(
!
value
)
{
giterr_set
(
GITERR_CONFIG
,
"The value to set cannot be NULL"
);
return
-
1
;
}
internal
=
git_vector_get
(
&
cfg
->
files
,
0
);
internal
=
git_vector_get
(
&
cfg
->
files
,
0
);
file
=
internal
->
file
;
file
=
internal
->
file
;
...
...
tests-clar/config/write.c
View file @
677dce8a
...
@@ -228,3 +228,17 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
...
@@ -228,3 +228,17 @@ void test_config_write__add_value_at_file_with_no_clrf_at_the_end(void)
git_config_free
(
cfg
);
git_config_free
(
cfg
);
}
}
void
test_config_write__can_set_a_value_to_NULL
(
void
)
{
git_repository
*
repository
;
git_config
*
config
;
repository
=
cl_git_sandbox_init
(
"testrepo.git"
);
cl_git_pass
(
git_repository_config
(
&
config
,
repository
));
cl_git_fail
(
git_config_set_string
(
config
,
"a.b.c"
,
NULL
));
git_config_free
(
config
);
cl_git_sandbox_cleanup
();
}
tests-clar/online/fetchhead.c
View file @
677dce8a
...
@@ -79,8 +79,8 @@ void test_online_fetchhead__no_merges(void)
...
@@ -79,8 +79,8 @@ void test_online_fetchhead__no_merges(void)
fetchhead_test_clone
();
fetchhead_test_clone
();
cl_git_pass
(
git_repository_config
(
&
config
,
g_repo
));
cl_git_pass
(
git_repository_config
(
&
config
,
g_repo
));
cl_git_pass
(
git_config_
set_string
(
config
,
"branch.master.remote"
,
NULL
));
cl_git_pass
(
git_config_
delete_entry
(
config
,
"branch.master.remote"
));
cl_git_pass
(
git_config_
set_string
(
config
,
"branch.master.merge"
,
NULL
));
cl_git_pass
(
git_config_
delete_entry
(
config
,
"branch.master.merge"
));
git_config_free
(
config
);
git_config_free
(
config
);
fetchhead_test_fetch
(
NULL
,
FETCH_HEAD_NO_MERGE_DATA
);
fetchhead_test_fetch
(
NULL
,
FETCH_HEAD_NO_MERGE_DATA
);
...
...
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