summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 065096c)
raw | patch | inline | side by side (parent: 065096c)
author | Bryan Donlan <bdonlan@fushizen.net> | |
Sun, 4 May 2008 05:37:54 +0000 (01:37 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 May 2008 21:17:01 +0000 (14:17 -0700) |
In particular, this function correctly handles cases where the pwd contains
spaces, quotes, and other troublesome metacharacters.
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
spaces, quotes, and other troublesome metacharacters.
Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh | patch | blob | history |
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 7c2a8ba77d312c3196767969a39687bfb12f74c9..d7ad13b95525886b45ddd3c22fcbf7a25f61ebf2 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
trap 'die' exit
+# The semantics of the editor variables are that of invoking
+# sh -c "$EDITOR \"$@\"" files ...
+#
+# If our trash directory contains shell metacharacters, they will be
+# interpreted if we just set $EDITOR directly, so do a little dance with
+# environment variables to work around this.
+#
+# In particular, quoting isn't enough, as the path may contain the same quote
+# that we're using.
+test_set_editor () {
+ FAKE_EDITOR="$1"
+ export FAKE_EDITOR
+ VISUAL='"$FAKE_EDITOR"'
+ export VISUAL
+}
+
test_tick () {
if test -z "${test_tick+set}"
then