dnb=$(git describe --contains "$nbase")
log "Importing akpm based on $db/$dnb"
-[ -d "../quilt-tmp" ] ||
- execute git clone -s -l -n -q . ../quilt-tmp
+[ -d "../tmp-akpm" ] && {
+ log "akpm import directory already exists"
+ exit 1
+}
-log '$' cd ../quilt-tmp
-cd ../quilt-tmp
-execute git checkout -b akpm/master "$db"
-git branch akpm/current-base
+execute git worktree add -b tmp-akpm/master ../tmp-akpm "$db"
+
+log '$' cd ../tmp-akpm
+cd ../tmp-akpm
+execute git branch tmp-akpm/current-base
sed_exp='
/NEXT_PATCHES_START/,/NEXT_PATCHES_END/{
- s/[ \t]*#.*NEXT_PATCHES_START[ \t]*\([^ \t]*\).*$/>\1/
- s/[ \t]*#.*NEXT_PATCHES_END.*$/</
s/[ \t]*#.*$//
/^[ \t]*$/!p
}
origin.patch)
;;
linux-next.patch)
- git branch akpm/current
+ execute git branch tmp-akpm/current
execute git merge --no-edit --no-stat "$dnb"
- git branch akpm/master-base
- ;;
- \>*)
- cbranch="${f#>}"
- [ "$cbranch" ] &&
- cref="$(git rev-parse --verify HEAD)"
- ;;
- \<)
- [ "$cbranch" ] && {
- [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
- git branch -f "akpm/$cbranch"
- cbranch=""
- }
+ execute git branch tmp-akpm/master-base
;;
*)
execute git am -s --patch-format=mbox "$mmotm/broken-out/$f"
esac
done
-[ "$cbranch" ] &&
- [ "$cref" != "$(git rev-parse --verify HEAD)" ] &&
- git branch -f "akpm/$cbranch"
-
log '$' cd $cpwd
cd $cpwd
-execute git fetch --force --no-tags ../quilt-tmp \
- refs/heads/akpm/master:refs/heads/akpm/master \
- refs/heads/akpm/master-base:refs/heads/akpm/master-base \
- refs/heads/akpm/current:refs/heads/akpm/current \
- refs/heads/akpm/current-base:refs/heads/akpm/current-base
+execute rm -rf ../tmp-akpm
+execute git worktree prune
-rm -rf ../quilt-tmp
+for i in akpm/current akpm/current-base akpm/master akpm/master-base; do
+ execute git branch -f $i tmp-$i
+ execute git branch -D tmp-$i
+done
exit 0