mirror of
https://github.com/git/git
synced 2024-08-28 03:59:25 +00:00
config.c: remove unnecessary header in minimum configuration file.
It is just silly to start the file called "config" with a comment that says "This is the config file." Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
9cebe90bc5
commit
53e7181cd9
8
config.c
8
config.c
|
@ -458,12 +458,6 @@ int git_config_set_multivar(const char* key, const char* value,
|
||||||
* If .git/config does not exist yet, write a minimal version.
|
* If .git/config does not exist yet, write a minimal version.
|
||||||
*/
|
*/
|
||||||
if (stat(config_filename, &st)) {
|
if (stat(config_filename, &st)) {
|
||||||
static const char contents[] =
|
|
||||||
"#\n"
|
|
||||||
"# This is the config file\n"
|
|
||||||
"#\n"
|
|
||||||
"\n";
|
|
||||||
|
|
||||||
free(store.key);
|
free(store.key);
|
||||||
|
|
||||||
/* if nothing to unset, error out */
|
/* if nothing to unset, error out */
|
||||||
|
@ -474,8 +468,6 @@ int git_config_set_multivar(const char* key, const char* value,
|
||||||
}
|
}
|
||||||
|
|
||||||
store.key = (char*)key;
|
store.key = (char*)key;
|
||||||
|
|
||||||
write(fd, contents, sizeof(contents)-1);
|
|
||||||
store_write_section(fd, key);
|
store_write_section(fd, key);
|
||||||
store_write_pair(fd, key, value);
|
store_write_pair(fd, key, value);
|
||||||
} else{
|
} else{
|
||||||
|
|
|
@ -12,10 +12,6 @@ test -f .git/config && rm .git/config
|
||||||
git-repo-config core.penguin "little blue"
|
git-repo-config core.penguin "little blue"
|
||||||
|
|
||||||
cat > expect << EOF
|
cat > expect << EOF
|
||||||
#
|
|
||||||
# This is the config file
|
|
||||||
#
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
penguin = little blue
|
penguin = little blue
|
||||||
EOF
|
EOF
|
||||||
|
@ -25,10 +21,6 @@ test_expect_success 'initial' 'cmp .git/config expect'
|
||||||
git-repo-config Core.Movie BadPhysics
|
git-repo-config Core.Movie BadPhysics
|
||||||
|
|
||||||
cat > expect << EOF
|
cat > expect << EOF
|
||||||
#
|
|
||||||
# This is the config file
|
|
||||||
#
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
penguin = little blue
|
penguin = little blue
|
||||||
Movie = BadPhysics
|
Movie = BadPhysics
|
||||||
|
@ -39,10 +31,6 @@ test_expect_success 'mixed case' 'cmp .git/config expect'
|
||||||
git-repo-config Cores.WhatEver Second
|
git-repo-config Cores.WhatEver Second
|
||||||
|
|
||||||
cat > expect << EOF
|
cat > expect << EOF
|
||||||
#
|
|
||||||
# This is the config file
|
|
||||||
#
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
penguin = little blue
|
penguin = little blue
|
||||||
Movie = BadPhysics
|
Movie = BadPhysics
|
||||||
|
@ -55,10 +43,6 @@ test_expect_success 'similar section' 'cmp .git/config expect'
|
||||||
git-repo-config CORE.UPPERCASE true
|
git-repo-config CORE.UPPERCASE true
|
||||||
|
|
||||||
cat > expect << EOF
|
cat > expect << EOF
|
||||||
#
|
|
||||||
# This is the config file
|
|
||||||
#
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
penguin = little blue
|
penguin = little blue
|
||||||
Movie = BadPhysics
|
Movie = BadPhysics
|
||||||
|
@ -76,10 +60,6 @@ test_expect_success 'replace with non-match (actually matching)' \
|
||||||
'git-repo-config core.penguin "very blue" !kingpin'
|
'git-repo-config core.penguin "very blue" !kingpin'
|
||||||
|
|
||||||
cat > expect << EOF
|
cat > expect << EOF
|
||||||
#
|
|
||||||
# This is the config file
|
|
||||||
#
|
|
||||||
|
|
||||||
[core]
|
[core]
|
||||||
penguin = very blue
|
penguin = very blue
|
||||||
Movie = BadPhysics
|
Movie = BadPhysics
|
||||||
|
|
Loading…
Reference in a new issue