aboutsummaryrefslogtreecommitdiff
path: root/alias.c
diff options
context:
space:
mode:
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 6aa164a36..a11229db9 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;
}