setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..
[gitweb.git] / alias.c
diff --git a/alias.c b/alias.c
index 6aa164a362427ffa5dc8616bcb01aec3f15b462b..a11229db9e67b7b651356be3fb1d4b3d1014a8bd 100644 (file)
--- 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;
 }