diff options
-rwxr-xr-x | tests/tartree-edit | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/tartree-edit b/tests/tartree-edit index 14eec68..5a7c6b4 100755 --- a/tests/tartree-edit +++ b/tests/tartree-edit @@ -2,6 +2,17 @@ set -e fail () { echo >&2 "$0: $*"; exit 1; } +play=.git/tartree-edit-work + +git_manip_play () { + local wd=$(pwd) + case "$wd" in + *.edit) fail "bad idea to run gitfetchinfo into a .edit tree!" ;; + esac + rm -rf $play + mkdir $play +} + case "$#.$1" in 2.edit|2.done) mode="$1"; arg="$2" ;; 3.gitfetchinfo) mode="$1"; arg="$2"; remote="$3" ;; @@ -56,13 +67,7 @@ gitfetchinfo_perhaps_commit () { } tryat_gitfetchinfo () { - local wd=$(pwd) - case "$wd" in - *.edit) fail "bad idea to run gitfetchinfo into a .edit tree!" ;; - esac - local play=.git/tartree-edit-work - rm -rf $play - mkdir $play + git_manip_play if test -d "$b.edit"; then cp -a "$b.edit"/. "$play"/. else |