completion tests: make the $cur variable local to the test helper functions
[gitweb.git] / t / t9902-completion.sh
index f490c1d05e75d96424ac2f8d95fc2fd5d41cc604..294a08cfe81e9fb6e49eb73718ae959b48f9ab08 100755 (executable)
@@ -98,7 +98,7 @@ test_gitcomp ()
 {
        local -a COMPREPLY &&
        sed -e 's/Z$//' >expected &&
-       cur="$1" &&
+       local cur="$1" &&
        shift &&
        __gitcomp "$@" &&
        print_comp &&
@@ -113,7 +113,7 @@ test_gitcomp_nl ()
 {
        local -a COMPREPLY &&
        sed -e 's/Z$//' >expected &&
-       cur="$1" &&
+       local cur="$1" &&
        shift &&
        __gitcomp_nl "$@" &&
        print_comp &&