diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-04-16 19:28:09 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-04-16 19:28:09 +0900 |
| commit | 2850232a21fa1c2548d4e4df9dbfb51e6423dcce (patch) | |
| tree | 8bc7edc13b8db632e01fd86d066a98ef81b5fb56 /help.c | |
| parent | 08c9757a76eaeae1a600b98932e65bd339a73e25 (diff) | |
| parent | 2eb6f09f7d9c02266f7e6ac8b1591abc8b10278d (diff) | |
| download | git-2850232a21fa1c2548d4e4df9dbfb51e6423dcce.tar.xz | |
Merge branch 'tz/completion'
The completion helper code now pays attention to repository-local
configuration (when available), which allows --list-cmds to honour
a repository specific setting of completion.commands, for example.
* tz/completion:
completion: use __git when calling --list-cmds
completion: fix multiple command removals
t9902: test multiple removals via completion.commands
git: read local config in --list-cmds
Diffstat (limited to 'help.c')
| -rw-r--r-- | help.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -375,13 +375,6 @@ void list_cmds_by_config(struct string_list *list) { const char *cmd_list; - /* - * There's no actual repository setup at this point (and even - * if there is, we don't really care; only global config - * matters). If we accidentally set up a repository, it's ok - * too since the caller (git --list-cmds=) should exit shortly - * anyway. - */ if (git_config_get_string_const("completion.commands", &cmd_list)) return; @@ -393,8 +386,8 @@ void list_cmds_by_config(struct string_list *list) const char *p = strchrnul(cmd_list, ' '); strbuf_add(&sb, cmd_list, p - cmd_list); - if (*cmd_list == '-') - string_list_remove(list, cmd_list + 1, 0); + if (sb.buf[0] == '-') + string_list_remove(list, sb.buf + 1, 0); else string_list_insert(list, sb.buf); strbuf_release(&sb); |
