summaryrefslogtreecommitdiffstats
path: root/t/t6000-lib.sh
diff options
context:
space:
mode:
authorJon Seymour <jon.seymour@gmail.com>2005-07-07 02:50:07 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 03:00:28 +0200
commit28346d2d3c6e609a618c6c429d865e9d5d50b998 (patch)
tree68aab83e0497a2cce7ff28689883917884fc6584 /t/t6000-lib.sh
parent[PATCH] Add t/t6003 with some --topo-order tests (diff)
downloadgit-28346d2d3c6e609a618c6c429d865e9d5d50b998.tar.xz
git-28346d2d3c6e609a618c6c429d865e9d5d50b998.zip
[PATCH] Write sed script directly into temp file, rather than a variable
When sed uses \n rather than ; as a separator (for BSD sed(1) compat), it is cleaner to use a file directly, rather than an environment variable containing \n characters. This change changes t/t6000 write to sed.script directly and changes the other tests to remove knowledge of sed.script. Signed-off-by: Jon Seymour <jon.seymour@gmail.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 't/t6000-lib.sh')
-rw-r--r--t/t6000-lib.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/t/t6000-lib.sh b/t/t6000-lib.sh
index 377e8eb77b..01f796e9c8 100644
--- a/t/t6000-lib.sh
+++ b/t/t6000-lib.sh
@@ -1,6 +1,6 @@
[ -d .git/refs/tags ] || mkdir -p .git/refs/tags
-sed_script="";
+:> sed.script
# Answer the sha1 has associated with the tag. The tag must exist in .git or .git/refs/tags
tag()
@@ -21,7 +21,7 @@ unique_commit()
}
# Save the output of a command into the tag specified. Prepend
-# a substitution script for the tag onto the front of $sed_script
+# a substitution script for the tag onto the front of sed.script
save_tag()
{
_tag=$1
@@ -29,14 +29,16 @@ save_tag()
shift 1
"$@" >.git/refs/tags/$_tag
- sed_script="s/$(tag $_tag)/$_tag/g
-$sed_script"
+ echo "s/$(tag $_tag)/$_tag/g" > sed.script.tmp
+ cat sed.script >> sed.script.tmp
+ rm sed.script
+ mv sed.script.tmp sed.script
}
# Replace unhelpful sha1 hashses with their symbolic equivalents
entag()
{
- sed "$sed_script"
+ sed -f sed.script
}
# Execute a command after first saving, then setting the GIT_AUTHOR_EMAIL