tests: in helpers-testrepo.sh switch from shell aliases to functions
authorArseniy Alekseyev <aalekseyev@janestreet.com>
Wed, 02 Oct 2024 14:49:07 +0100
changeset 51918 813226b3b4ca
parent 51917 1d6982827c4b
child 51919 ceaf92d6d380
tests: in helpers-testrepo.sh switch from shell aliases to functions The reason is that I want this script to work in non-interactive shells too. (will be used in the next commit)
tests/helpers-testrepo.sh
--- a/tests/helpers-testrepo.sh	Fri Sep 27 17:25:15 2024 +0100
+++ b/tests/helpers-testrepo.sh	Wed Oct 02 14:49:07 2024 +0100
@@ -52,9 +52,17 @@
 # Use the system hg command if the bundled hg can't read the repository with
 # no warning nor error.
 if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then
-    alias testrepohg=syshg
-    alias testrepohgenv=syshgenv
+    testrepohg() {
+        syshg "$@"
+    }
+    testrepohgenv() {
+        syshgenv "$@"
+    }
 else
-    alias testrepohg="hg $extraoptions"
-    alias testrepohgenv=:
+    testrepohg() {
+        hg $extraoptions "$@"
+    }
+    testrepohgenv() {
+        :
+    }
 fi