summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-10-16 07:15:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-10-16 07:15:59 (GMT)
commit506ee60d222f94a1598769feaba3b3621bd9fa1a (patch)
tree3968c7bb84c944483266f25de658b5882c919047 /t
parent6d8f8ebb74d21b51cfbf427a436094134af36ee2 (diff)
parentfef5f7fc43541e109674ab8f1d2baed733e9b7d3 (diff)
downloadgit-506ee60d222f94a1598769feaba3b3621bd9fa1a.zip
git-506ee60d222f94a1598769feaba3b3621bd9fa1a.tar.gz
git-506ee60d222f94a1598769feaba3b3621bd9fa1a.tar.bz2
Merge branch 'ts/alias-of-alias'
An alias that expands to another alias has so far been forbidden, but now it is allowed to create such an alias. * ts/alias-of-alias: t0014: introduce an alias testing suite alias: show the call history when an alias is looping alias: add support for aliases of an alias
Diffstat (limited to 't')
-rwxr-xr-xt/t0014-alias.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/t/t0014-alias.sh b/t/t0014-alias.sh
new file mode 100755
index 0000000..a070e64
--- /dev/null
+++ b/t/t0014-alias.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+test_description='git command aliasing'
+
+. ./test-lib.sh
+
+test_expect_success 'nested aliases - internal execution' '
+ git config alias.nested-internal-1 nested-internal-2 &&
+ git config alias.nested-internal-2 status &&
+ git nested-internal-1 >output &&
+ test_i18ngrep "^On branch " output
+'
+
+test_expect_success 'nested aliases - mixed execution' '
+ git config alias.nested-external-1 nested-external-2 &&
+ git config alias.nested-external-2 "!git nested-external-3" &&
+ git config alias.nested-external-3 status &&
+ git nested-external-1 >output &&
+ test_i18ngrep "^On branch " output
+'
+
+test_expect_success 'looping aliases - internal execution' '
+ git config alias.loop-internal-1 loop-internal-2 &&
+ git config alias.loop-internal-2 loop-internal-3 &&
+ git config alias.loop-internal-3 loop-internal-2 &&
+ test_must_fail git loop-internal-1 2>output &&
+ test_i18ngrep "^fatal: alias loop detected: expansion of" output
+'
+
+# This test is disabled until external loops are fixed, because would block
+# the test suite for a full minute.
+#
+#test_expect_failure 'looping aliases - mixed execution' '
+# git config alias.loop-mixed-1 loop-mixed-2 &&
+# git config alias.loop-mixed-2 "!git loop-mixed-1" &&
+# test_must_fail git loop-mixed-1 2>output &&
+# test_i18ngrep "^fatal: alias loop detected: expansion of" output
+#'
+
+test_done