Skip to content

Commit 019409b

Browse files
committed
Don't error on missing section, just continue
1 parent c4d7fa9 commit 019409b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/config_file.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,12 +1035,11 @@ static int read_on_variable(
10351035
GIT_UNUSED(line);
10361036
GIT_UNUSED(line_len);
10371037

1038-
if (!current_section) {
1039-
giterr_set(GITERR_CONFIG, "no section for key: %s", var_name);
1040-
return -1;
1038+
if (current_section) {
1039+
git_buf_puts(&buf, current_section);
1040+
git_buf_putc(&buf, '.');
10411041
}
1042-
git_buf_puts(&buf, current_section);
1043-
git_buf_putc(&buf, '.');
1042+
10441043
for (c = var_name; *c; c++)
10451044
git_buf_putc(&buf, git__tolower(*c));
10461045

0 commit comments

Comments
 (0)