From c6b4db3983209a71280a60bf9e66bd5610611b32 Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Wed, 4 Jun 2008 11:25:39 +1000 Subject: [PATCH] Don't delete branched every time. --- update_trees | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/update_trees b/update_trees index a1925e6..c17428c 100755 --- a/update_trees +++ b/update_trees @@ -63,12 +63,23 @@ for name in $quilters; do continue } - execute git branch -D "quilt/$name" - execute git checkout -b "quilt/$name" "$rbase" || sh -i || { + git show-ref --quiet --verify "refs/heads/quilt/$name" || + execute git branch "quilt/$name" "$rbase" || sh -i || { + [ -f "$sfile.orig" ] && + mv -f "$sfile.orig" "$sfile" + exit 1 + } + execute git checkout "quilt/$name" || sh -i || { [ -f "$sfile.orig" ] && mv -f "$sfile.orig" "$sfile" exit 1 } + execute git reset --hard "$rbase" || sh -i || { + [ -f "$sfile.orig" ] && + mv -f "$sfile.orig" "$sfile" + exit 1 + } + author=$(grep -v '^#' ../real_control | awk -F ' ' '$3=="'"$name"'" { printf("%s", $1); }' | sed 's/,.*$//') execute git quiltimport --author "$author" --patches "../quilt/$name" || sh -i || { [ -f "$sfile.orig" ] && -- 2.39.5