-[ -d "../quilt-tmp" ] ||
- execute git clone -s -l -n -q . ../quilt-tmp
-
-log '$' cd ../quilt-tmp
-cd ../quilt-tmp
-execute git reset --hard "$base"
-GIT_EDITOR=: execute git merge "$nbase" || bash -i || exit 1
-git branch base
-
-for f in $(cat "$mmotm/series"); do
- [ "$f" = "origin.patch" ] && continue
- [ "$f" = "linux-next.patch" ] && continue
- execute git am "$mmotm/broken-out/$f" ||
- bash -i ||
- break
+execute git worktree add -b tmp-akpm/master ../tmp-akpm "$db" ||
+ $SHELL -i || exit
+
+log '$' cd ../tmp-akpm
+cd ../tmp-akpm
+execute git branch tmp-akpm/current-base ||
+ $SHELL -i || exit
+
+sed_exp='
+s/\r$//
+/NEXT_PATCHES_START/,/NEXT_PATCHES_END/{
+ s/[ \t]*#.*$//
+ /^[ \t]*$/!p
+}
+/^linux-next.patch/p'
+patches=$(sed -n "$sed_exp" "$sfile")
+
+for f in $patches; do
+ case "$f" in
+ origin.patch)
+ ;;
+ linux-next.patch)
+ execute git branch tmp-akpm/current ||
+ $SHELL -i || exit
+ execute git merge --no-edit --no-stat "$dnb" || {
+ check_unmerged_files akpm-current
+
+ git diff 2>&1 | grep -E -q '<<<<<|^\*' && {
+ $SHELL -i || exit
+ }
+ GIT_EDITOR=: execute git commit -v -a
+ }
+ [ -f "../merge-fixes/akpm-current" ] && {
+ for p in $(cat "../merge-fixes/akpm-current"); do
+ $(dirname $0)/merge_fix -n "$p" ||
+ $SHELL -i || exit
+ done
+ }
+ execute git branch tmp-akpm/master-base ||
+ $SHELL -i || exit
+ ;;
+ *)
+ execute git am -s --patch-format=mbox "$mmotm/broken-out/$f" ||
+ $SHELL -i || exit
+ ;;
+ esac