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
b08683ff
Commit
b08683ff
authored
Jul 12, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: Rename `del` to `delete
parent
bfbb5562
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
include/git2/config.h
+1
-1
src/config.c
+1
-1
tests/t15-config.c
+4
-4
No files found.
include/git2/config.h
View file @
b08683ff
...
...
@@ -259,7 +259,7 @@ GIT_EXTERN(int) git_config_set_string(git_config *cfg, const char *name, const c
* @param cfg the configuration
* @param name the variable to delete
*/
GIT_EXTERN
(
int
)
git_config_del
(
git_config
*
cfg
,
const
char
*
name
);
GIT_EXTERN
(
int
)
git_config_del
ete
(
git_config
*
cfg
,
const
char
*
name
);
/**
* Perform an operation on each config variable.
...
...
src/config.c
View file @
b08683ff
...
...
@@ -167,7 +167,7 @@ int git_config_foreach(git_config *cfg, int (*fn)(const char *, const char *, vo
return
ret
;
}
int
git_config_del
(
git_config
*
cfg
,
const
char
*
name
)
int
git_config_del
ete
(
git_config
*
cfg
,
const
char
*
name
)
{
return
git_config_set_string
(
cfg
,
name
,
NULL
);
}
...
...
tests/t15-config.c
View file @
b08683ff
...
...
@@ -246,7 +246,7 @@ BEGIN_TEST(config12, "delete a value")
git_config_free
(
cfg
);
must_pass
(
git_config_open_ondisk
(
&
cfg
,
CONFIG_BASE
"/config9"
));
must_pass
(
git_config_del
(
cfg
,
"core.dummy"
));
must_pass
(
git_config_del
ete
(
cfg
,
"core.dummy"
));
git_config_free
(
cfg
);
must_pass
(
git_config_open_ondisk
(
&
cfg
,
CONFIG_BASE
"/config9"
));
...
...
@@ -260,7 +260,7 @@ BEGIN_TEST(config13, "can't delete a non-existent value")
/* By freeing the config, we make sure we flush the values */
must_pass
(
git_config_open_ondisk
(
&
cfg
,
CONFIG_BASE
"/config9"
));
must_be_true
(
git_config_del
(
cfg
,
"core.imaginary"
)
==
GIT_ENOTFOUND
);
must_be_true
(
git_config_del
ete
(
cfg
,
"core.imaginary"
)
==
GIT_ENOTFOUND
);
git_config_free
(
cfg
);
END_TEST
...
...
@@ -281,7 +281,7 @@ BEGIN_TEST(config15, "add a variable in an existing section")
must_pass
(
git_config_set_int
(
cfg
,
"empty.tmp"
,
5
));
must_pass
(
git_config_get_int
(
cfg
,
"empty.tmp"
,
&
i
));
must_be_true
(
i
==
5
);
must_pass
(
git_config_del
(
cfg
,
"empty.tmp"
));
must_pass
(
git_config_del
ete
(
cfg
,
"empty.tmp"
));
git_config_free
(
cfg
);
END_TEST
...
...
@@ -295,7 +295,7 @@ BEGIN_TEST(config16, "add a variable in a new section")
must_pass
(
git_config_set_int
(
cfg
,
"section.tmp"
,
5
));
must_pass
(
git_config_get_int
(
cfg
,
"section.tmp"
,
&
i
));
must_be_true
(
i
==
5
);
must_pass
(
git_config_del
(
cfg
,
"section.tmp"
));
must_pass
(
git_config_del
ete
(
cfg
,
"section.tmp"
));
git_config_free
(
cfg
);
/* As the section wasn't removed, owerwrite the file */
...
...
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