summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-07-20 16:29:59 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-07-20 16:29:59 -0700
commit099b74b4b267f72dfab916f28a0b17fceb293900 (patch)
treea11eb911392ccd33fa352b87f6e22eacabd9149f
parentRelNotes: mention "sha1dc: optionally use sha1collisiondetection as a submodule" (diff)
parentalias: compare alias name *case-insensitively* (diff)
downloadtgif-099b74b4b267f72dfab916f28a0b17fceb293900.tar.xz
Merge branch 'js/alias-case-sensitivity'
A recent update broke an alias that contained an uppercase letter. * js/alias-case-sensitivity: alias: compare alias name *case-insensitively* t1300: demonstrate that CamelCased aliases regressed
-rw-r--r--alias.c2
-rwxr-xr-xt/t1300-repo-config.sh7
2 files changed, 8 insertions, 1 deletions
diff --git a/alias.c b/alias.c
index 39f622e414..bf146e5263 100644
--- a/alias.c
+++ b/alias.c
@@ -11,7 +11,7 @@ static int config_alias_cb(const char *key, const char *value, void *d)
struct config_alias_data *data = d;
const char *p;
- if (skip_prefix(key, "alias.", &p) && !strcmp(p, data->alias))
+ if (skip_prefix(key, "alias.", &p) && !strcasecmp(p, data->alias))
return git_config_string((const char **)&data->v, key, value);
return 0;
diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh
index a37ef04222..364a537000 100755
--- a/t/t1300-repo-config.sh
+++ b/t/t1300-repo-config.sh
@@ -1075,6 +1075,13 @@ test_expect_success 'git -c works with aliases of builtins' '
test_cmp expect actual
'
+test_expect_success 'aliases can be CamelCased' '
+ test_config alias.CamelCased "rev-parse HEAD" &&
+ git CamelCased >out &&
+ git rev-parse HEAD >expect &&
+ test_cmp expect out
+'
+
test_expect_success 'git -c does not split values on equals' '
echo "value with = in it" >expect &&
git -c core.foo="value with = in it" config core.foo >actual &&