add quotes around $GOT_TEST_ROOT and avoid mktemp -p; suggested by naddy
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
diff --git a/regress/cmdline/Makefile b/regress/cmdline/Makefile
index 081593c..e32b5a1 100644
--- a/regress/cmdline/Makefile
+++ b/regress/cmdline/Makefile
@@ -6,78 +6,78 @@ NOOBJ=Yes
GOT_TEST_ROOT=/tmp
checkout:
- ./checkout.sh -q -r $(GOT_TEST_ROOT)
+ ./checkout.sh -q -r "$(GOT_TEST_ROOT)"
update:
- ./update.sh -q -r $(GOT_TEST_ROOT)
+ ./update.sh -q -r "$(GOT_TEST_ROOT)"
status:
- ./status.sh -q -r $(GOT_TEST_ROOT)
+ ./status.sh -q -r "$(GOT_TEST_ROOT)"
log:
- ./log.sh -q -r $(GOT_TEST_ROOT)
+ ./log.sh -q -r "$(GOT_TEST_ROOT)"
add:
- ./add.sh -q -r $(GOT_TEST_ROOT)
+ ./add.sh -q -r "$(GOT_TEST_ROOT)"
rm:
- ./rm.sh -q -r $(GOT_TEST_ROOT)
+ ./rm.sh -q -r "$(GOT_TEST_ROOT)"
diff:
- ./diff.sh -q -r $(GOT_TEST_ROOT)
+ ./diff.sh -q -r "$(GOT_TEST_ROOT)"
blame:
- ./blame.sh -q -r $(GOT_TEST_ROOT)
+ ./blame.sh -q -r "$(GOT_TEST_ROOT)"
branch:
- ./branch.sh -q -r $(GOT_TEST_ROOT)
+ ./branch.sh -q -r "$(GOT_TEST_ROOT)"
tag:
- ./tag.sh -q -r $(GOT_TEST_ROOT)
+ ./tag.sh -q -r "$(GOT_TEST_ROOT)"
ref:
- ./ref.sh -q -r $(GOT_TEST_ROOT)
+ ./ref.sh -q -r "$(GOT_TEST_ROOT)"
commit:
- ./commit.sh -q -r $(GOT_TEST_ROOT)
+ ./commit.sh -q -r "$(GOT_TEST_ROOT)"
revert:
- ./revert.sh -q -r $(GOT_TEST_ROOT)
+ ./revert.sh -q -r "$(GOT_TEST_ROOT)"
cherrypick:
- ./cherrypick.sh -q -r $(GOT_TEST_ROOT)
+ ./cherrypick.sh -q -r "$(GOT_TEST_ROOT)"
backout:
- ./backout.sh -q -r $(GOT_TEST_ROOT)
+ ./backout.sh -q -r "$(GOT_TEST_ROOT)"
rebase:
- ./rebase.sh -q -r $(GOT_TEST_ROOT)
+ ./rebase.sh -q -r "$(GOT_TEST_ROOT)"
import:
- ./import.sh -q -r $(GOT_TEST_ROOT)
+ ./import.sh -q -r "$(GOT_TEST_ROOT)"
histedit:
- ./histedit.sh -q -r $(GOT_TEST_ROOT)
+ ./histedit.sh -q -r "$(GOT_TEST_ROOT)"
integrate:
- ./integrate.sh -q -r $(GOT_TEST_ROOT)
+ ./integrate.sh -q -r "$(GOT_TEST_ROOT)"
stage:
- ./stage.sh -q -r $(GOT_TEST_ROOT)
+ ./stage.sh -q -r "$(GOT_TEST_ROOT)"
unstage:
- ./unstage.sh -q -r $(GOT_TEST_ROOT)
+ ./unstage.sh -q -r "$(GOT_TEST_ROOT)"
cat:
- ./cat.sh -q -r $(GOT_TEST_ROOT)
+ ./cat.sh -q -r "$(GOT_TEST_ROOT)"
clone:
- ./clone.sh -q -r $(GOT_TEST_ROOT)
+ ./clone.sh -q -r "$(GOT_TEST_ROOT)"
fetch:
- ./fetch.sh -q -r $(GOT_TEST_ROOT)
+ ./fetch.sh -q -r "$(GOT_TEST_ROOT)"
tree:
- ./tree.sh -q -r $(GOT_TEST_ROOT)
+ ./tree.sh -q -r "$(GOT_TEST_ROOT)"
.include <bsd.regress.mk>
diff --git a/regress/cmdline/common.sh b/regress/cmdline/common.sh
index d022c28..cde580f 100644
--- a/regress/cmdline/common.sh
+++ b/regress/cmdline/common.sh
@@ -169,7 +169,7 @@ test_init()
echo "No test name provided" >&2
return 1
fi
- local testroot=`mktemp -p $GOT_TEST_ROOT -d got-test-$testname-XXXXXXXX`
+ local testroot=$(mktemp -d "$GOT_TEST_ROOT/got-test-$testname-XXXXXXXX")
mkdir $testroot/repo
git_init $testroot/repo
if [ -z "$no_tree" ]; then
diff --git a/regress/cmdline/import.sh b/regress/cmdline/import.sh
index 8678e99..5d5816f 100755
--- a/regress/cmdline/import.sh
+++ b/regress/cmdline/import.sh
@@ -18,7 +18,7 @@
test_import_basic() {
local testname=import_basic
- local testroot=`mktemp -p $GOT_TEST_ROOT -d got-test-$testname-XXXXXXXX`
+ local testroot=`mktemp -d "$GOT_TEST_ROOT/got-test-$testname-XXXXXXXX"`
got init $testroot/repo
@@ -170,7 +170,7 @@ test_import_requires_new_branch() {
test_import_ignores() {
local testname=import_ignores
- local testroot=`mktemp -p $GOT_TEST_ROOT -d got-test-$testname-XXXXXXXX`
+ local testroot=`mktemp -d "$GOT_TEST_ROOT/got-test-$testname-XXXXXXXX"`
got init $testroot/repo
@@ -200,7 +200,7 @@ test_import_ignores() {
test_import_empty_dir() {
local testname=import_empty_dir
- local testroot=`mktemp -p $GOT_TEST_ROOT -d got-test-$testname-XXXXXXXX`
+ local testroot=`mktemp -d "$GOT_TEST_ROOT/got-test-$testname-XXXXXXXX"`
got init $testroot/repo
@@ -243,7 +243,7 @@ test_import_empty_dir() {
test_import_symlink() {
local testname=import_symlink
- local testroot=`mktemp -p $GOT_TEST_ROOT -d got-test-$testname-XXXXXXXX`
+ local testroot=`mktemp -d "$GOT_TEST_ROOT/got-test-$testname-XXXXXXXX"`
got init $testroot/repo