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" ;;
}
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