mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
Merge branch 'jc/optional-path'
"git config get --path" segfaulted on an ":(optional)path" that does not exist, which has been corrected. * jc/optional-path: config: really treat missing optional path as not configured config: really pretend missing :(optional) value is not there config: mark otherwise unused function as file-scope static
This commit is contained in:
12
fsck.c
12
fsck.c
@@ -1398,14 +1398,16 @@ int git_fsck_config(const char *var, const char *value,
|
||||
|
||||
if (strcmp(var, "fsck.skiplist") == 0) {
|
||||
char *path;
|
||||
struct strbuf sb = STRBUF_INIT;
|
||||
|
||||
if (git_config_pathname(&path, var, value))
|
||||
return -1;
|
||||
strbuf_addf(&sb, "skiplist=%s", path);
|
||||
free(path);
|
||||
fsck_set_msg_types(options, sb.buf);
|
||||
strbuf_release(&sb);
|
||||
if (path) {
|
||||
struct strbuf sb = STRBUF_INIT;
|
||||
strbuf_addf(&sb, "skiplist=%s", path);
|
||||
free(path);
|
||||
fsck_set_msg_types(options, sb.buf);
|
||||
strbuf_release(&sb);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user