summaryrefslogtreecommitdiff
path: root/alias.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-09-03 19:17:52 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-09-03 19:17:52 -0700
commitfa6d3749edce0a5ba8c9150f984cc307e0092d0d (patch)
tree3ca97911ade88435507d1151fb5885087ccf7f55 /alias.c
parentMerge branch 'nd/dwim-wildcards-as-pathspecs' into maint (diff)
parentconfig: silence warnings for command names with invalid keys (diff)
downloadtgif-fa6d3749edce0a5ba8c9150f984cc307e0092d0d.tar.xz
Merge branch 'jk/fix-alias-pager-config-key-warnings' into maint
Because the configuration system does not allow "alias.0foo" and "pager.0foo" as the configuration key, the user cannot use '0foo' as a custom command name anyway, but "git 0foo" tried to look these keys up and emitted useless warnings before saying '0foo is not a git command'. These warning messages have been squelched. * jk/fix-alias-pager-config-key-warnings: config: silence warnings for command names with invalid keys
Diffstat (limited to 'alias.c')
-rw-r--r--alias.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/alias.c b/alias.c
index 6aa164a362..a11229db9e 100644
--- a/alias.c
+++ b/alias.c
@@ -5,7 +5,8 @@ char *alias_lookup(const char *alias)
char *v = NULL;
struct strbuf key = STRBUF_INIT;
strbuf_addf(&key, "alias.%s", alias);
- git_config_get_string(key.buf, &v);
+ if (git_config_key_is_valid(key.buf))
+ git_config_get_string(key.buf, &v);
strbuf_release(&key);
return v;
}