chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8a00b85
)
tests: gitrepo-edit: wip, new .edit style
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 19 Feb 2014 21:35:27 +0000
(21:35 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Wed, 5 Mar 2014 18:29:06 +0000
(18:29 +0000)
tests/gitrepo-edit
patch
|
blob
|
history
diff --git
a/tests/gitrepo-edit
b/tests/gitrepo-edit
index 27be703a64b5747973fdb70dfdffb9f4d0848c44..b1d60770481e56387e48b98211053300eecec3d6 100755
(executable)
--- a/
tests/gitrepo-edit
+++ b/
tests/gitrepo-edit
@@
-26,7
+26,6
@@
tryat_pre () {
tryat_edit () {
local b="$1"
tryat_edit () {
local b="$1"
- local i="$2"
if test -d "$b.edit"; then
echo "$b.edit already exists"
exit 0
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")
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 "$b.tar"
- rm -rf "$b.tmp"
echo "$b.edit ready"
exit 0
fi
echo "$b.edit ready"
exit 0
fi
@@
-44,13
+42,9
@@
tryat_edit () {
tryat_done () {
local b="$1"
tryat_done () {
local b="$1"
- local i="$2"
if test -d "$b.edit"; then
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"
mv "$b.edit" "$b.tmp"
rm -rf "$b.tmp"
echo "$b.tar regenerated"
@@
-64,13
+58,11
@@
tryat_done () {
tryat () {
local b="$1"
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
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.*"
}
fail "unexpected situation in $b.*"
}