summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-02-19 21:35:27 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-03-05 18:29:06 +0000
commitcf626a98aadd11b43a289dc18e18edb7eae105e6 (patch)
treea2d798cd13de2b1780ecbb1d6f56c3be43ca1a6d /tests
parent8a00b8522aa909f8dd075c520a470c5c81d715db (diff)
tests: gitrepo-edit: wip, new .edit style
Diffstat (limited to 'tests')
-rwxr-xr-xtests/gitrepo-edit18
1 files changed, 5 insertions, 13 deletions
diff --git a/tests/gitrepo-edit b/tests/gitrepo-edit
index 27be703..b1d6077 100755
--- a/tests/gitrepo-edit
+++ b/tests/gitrepo-edit
@@ -26,7 +26,6 @@ tryat_pre () {
tryat_edit () {
local b="$1"
- local i="$2"
if test -d "$b.edit"; then
echo "$b.edit already exists"
exit 0
@@ -34,9 +33,8 @@ tryat_edit () {
if test -f "$b.tar"; then
mkdir "$b.tmp"
(set -e; cd "$b.tmp"; tar xf "$b.tar")
- mv "$b.tmp/$i" "$b.edit"
+ mv "$b.tmp" "$b.edit"
rm "$b.tar"
- rm -rf "$b.tmp"
echo "$b.edit ready"
exit 0
fi
@@ -44,13 +42,9 @@ tryat_edit () {
tryat_done () {
local b="$1"
- local i="$2"
if test -d "$b.edit"; then
- mkdir "$b.tmp"
- cp -al "$b.edit" "$b.tmp/$i"
- (set -e; cd "$b.tmp"; tar cf "$b.tmp/tar $i")
- mv "$b.tmp/tar" "$b.tar"
- rm -rf "$b.tmp"
+ (set -e; cd "$b.edit"; tar cf "$b.tmp" *)
+ mv "$b.tmp" "$b.tar"
mv "$b.edit" "$b.tmp"
rm -rf "$b.tmp"
echo "$b.tar regenerated"
@@ -64,13 +58,11 @@ tryat_done () {
tryat () {
local b="$1"
- local i="${b##*/}"
- case "$i" in *_*.git) i="${i%_*.git}.git";; esac
if ! test -f "$b.tar" && ! test -f "$b.edit"; then
return
fi
- tryat_pre "$b" "$i"
- tryat_$mode "$b" "$i"
+ tryat_pre "$b"
+ tryat_$mode "$b"
fail "unexpected situation in $b.*"
}