+ reportecho4 "--> not merging, already had this one rejected before"
+ elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then
+ git checkout "$realbase"
+ org=`git rev-parse HEAD`
+ if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
+ git reset --hard "$org"
+ GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
+ reportdo4 cat "$t"
+ reportecho4 "--> merge failed"
+ elif ! "$SELF" compile -n 2>&1 | tee "$t"; then
+ git reset --hard "$org"
+ GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
+ reportdo4 cat "$t"
+ reportecho4 "--> compile failed"
+ elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
+ git reset --hard "$org"
+ GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
+ note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
+ if [ x"$note" = x"del" ]; then
+ git push origin :"${ref#refs/remotes/origin/}"
+ reportecho4 "--> test failed, branch deleted"
+ elif [ -n "$note" ]; then
+ reportdo4 echo "$note"
+ reportecho4 "--> test failed"
+ else
+ reportecho4 "--> test failed, postponed"
+ fi
+ else
+ echo "MERGING"
+ case ",`repoflags "$d"`," in
+ *,svn,*)
+ # we do quite a mess here... luckily we know $org
+ git fetch # svn needs to be current
+ git rebase -i --onto origin/master "$org"
+ git svn dcommit --add-author-from
+ git reset --hard "$org"
+ ;;
+ *)
+ git push origin HEAD
+ ;;
+ esac
+ reportecho4 "--> MERGED"
+ if yesno "Delete original branch \"$ref\"?"; then
+ git push origin :"${ref#refs/remotes/origin/}"
+ reportecho4 "--> branch deleted"
+ fi
+ fi