mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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 -h
This commit is contained in:
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] == '!') {
|
||||
|
||||
Reference in New Issue
Block a user