Merge branch 'js/alias-case-sensitivity' into maint

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
This commit is contained in:
Junio C Hamano 2017-07-21 15:03:38 -07:00
commit bdea5bae22
2 changed files with 8 additions and 1 deletions

View File

@ -10,7 +10,7 @@ static int config_alias_cb(const char *key, const char *value, void *d)
struct config_alias_data *data = d; struct config_alias_data *data = d;
const char *p; 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 git_config_string((const char **)&data->v, key, value);
return 0; return 0;

View File

@ -1075,6 +1075,13 @@ test_expect_success 'git -c works with aliases of builtins' '
test_cmp expect actual 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' ' test_expect_success 'git -c does not split values on equals' '
echo "value with = in it" >expect && echo "value with = in it" >expect &&
git -c core.foo="value with = in it" config core.foo >actual && git -c core.foo="value with = in it" config core.foo >actual &&