]> git.ozlabs.org Git - next-scripts/commitdiff
Don't delete branched every time.
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Jun 2008 01:25:39 +0000 (11:25 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 4 Jun 2008 01:25:39 +0000 (11:25 +1000)
update_trees

index a1925e6c7047ff557ec53bee7b4e3808b7a9eb6f..c17428c15734e0e47c0d01431ce3cbedb8457fae 100755 (executable)
@@ -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" ] &&