Merge branch 'rs/tighten-alias-help'
"git -c alias.foo=bar foo -h baz" reported "'foo' is aliased to 'bar'" and then went on to run "git foo -h baz", which was unexpected. Tighten the rule so that alias expansion is reported only when "-h" is the sole option. * rs/tighten-alias-help: git: show alias info only with lone -hmaint
commit
2823d928b4
2
git.c
2
git.c
|
|
@ -371,7 +371,7 @@ static int handle_alias(struct strvec *args)
|
|||
alias_command = args->v[0];
|
||||
alias_string = alias_lookup(alias_command);
|
||||
if (alias_string) {
|
||||
if (args->nr > 1 && !strcmp(args->v[1], "-h"))
|
||||
if (args->nr == 2 && !strcmp(args->v[1], "-h"))
|
||||
fprintf_ln(stderr, _("'%s' is aliased to '%s'"),
|
||||
alias_command, alias_string);
|
||||
if (alias_string[0] == '!') {
|
||||
|
|
|
|||
Loading…
Reference in New Issue