@@ -140,38 +140,27 @@ then
export GIT_INDEX_VERSION
fi
-if test -n "$TEST_GIT_INDEX_VERSION"
-then
- if test -n "$GIT_TEST_INDEX_VERSION"
- then
- echo "warning: the TEST_GIT_INDEX_VERSION variable has been renamed to GIT_TEST_INDEX_VERSION"
- else
- echo "error: the TEST_GIT_INDEX_VERSION variable has been renamed to GIT_TEST_INDEX_VERSION"
- exit 1
- fi
-fi
-
-if test -n "$GIT_FSMONITOR_TEST"
-then
- if test -n "$GIT_TEST_FSMONITOR"
- then
- echo "warning: the GIT_FSMONITOR_TEST variable has been renamed to GIT_TEST_FSMONITOR"
- else
- echo "error: the GIT_FSMONITOR_TEST variable has been renamed to GIT_TEST_FSMONITOR"
- exit 1
- fi
-fi
+check_var_migration () {
+ old_name=$1 new_name=$2
+ eval "old_isset=\${${old_name}:+isset}"
+ eval "new_isset=\${${new_name}:+isset}"
+ case "$old_isset,$new_isset" in
+ isset,)
+ echo >&2 "warning: $old_name is now $new_name"
+ echo >&2 "hint: set $new_name too during the transition period"
+ eval "$new_name=\$$old_name"
+ ;;
+ isset,isset)
+ # do this later
+ # echo >&2 "warning: $old_name is now $new_name"
+ # echo >&2 "hint: remove $old_name"
+ ;;
+ esac
+}
-if test -n "$GIT_FORCE_PRELOAD_TEST"
-then
- if test -n "$GIT_TEST_PRELOAD_INDEX"
- then
- echo "warning: the GIT_FORCE_PRELOAD_TEST variable has been renamed to GIT_TEST_PRELOAD_INDEX"
- else
- echo "error: the GIT_FORCE_PRELOAD_TEST variable has been renamed to GIT_TEST_PRELOAD_INDEX"
- exit 1
- fi
-fi
+check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
+check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
+check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
# Add libc MALLOC and MALLOC_PERTURB test
# only if we are not executing the test with valgrind