diff options
| author | Kristoffer Haugsbakk <code@khaugsbakk.name> | 2025-09-17 22:24:15 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-17 13:47:23 -0700 |
| commit | 65d33db48e5a2c6dbf3f33d6eaa987f55dabe26a (patch) | |
| tree | 810d1adf2537a7761db854849c03f5345fd55582 | |
| parent | bf68b116997a0471dfccf7dcced00eb7d8b66982 (diff) | |
t0014: test shadowing of aliases for a sample of builtins
The previous commit added tests for shadowing deprecated builtins.
Let’s make the test suite more complete by exercising a sample of
the builtins and in turn test the documentation for git-config(1):
To avoid confusion and troubles with script usage, aliases that hide
existing Git commands are ignored except for deprecated commands.
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rwxr-xr-x | t/t0014-alias.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh index 1b196ed9d6..07a53e7366 100755 --- a/t/t0014-alias.sh +++ b/t/t0014-alias.sh @@ -95,4 +95,21 @@ test_expect_success 'can alias-shadow via two deprecated builtins' ' test_cmp expect actual ' +cannot_alias_regular_builtin () { + cmd="$1" && + # some git(1) commands will fail... (see above) + test_might_fail git "$cmd" -h >expect && + test_file_not_empty expect && + test_might_fail git -c alias."$cmd"=status "$cmd" -h >actual && + test_cmp expect actual +} + +test_expect_success 'cannot alias-shadow a sample of regular builtins' ' + for cmd in grep check-ref-format interpret-trailers \ + checkout-index fast-import diagnose rev-list prune + do + cannot_alias_regular_builtin "$cmd" || return 1 + done +' + test_done |
