Skip to content

Commit

Permalink
Merge branch 'CamelCased-aliases'
Browse files Browse the repository at this point in the history
This topic branch fixes a regression introduced with Git v2.13.3, where
CamelCased aliases no longer resolved correctly all of a sudden.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Jul 14, 2017
2 parents 1224201 + eeb37a1 commit af0c222
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions t/t1300-repo-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down

0 comments on commit af0c222

Please sign in to comment.