Skip to content

Commit

Permalink
Problem: mr-merge not returning to the previous branch
Browse files Browse the repository at this point in the history
In certain cases (for example, if there was more than one
patch) mr-merge fails to return to the previous branch and
perform a merge.

Solution: try to guess the previous branch only if resuming
a merge.

I suspect that it will only be functional in the simplest case
of a single patch, so it'll have to be fixed down the road.
  • Loading branch information
yrashk committed Jul 24, 2018
1 parent df4de20 commit f273563
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cli/sit-mr-merge
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ if [ "${curbranch}" != "merge-${item}-${mr}" ]; then
git am -3 $(ls ${repo}/items/${item}/${mr}/git/*.patch) || exit 2
else
echo "Reusing current merge branch"
# Find the branch we forked from
forkpoint=$(git merge-base --fork-point HEAD)
curbranch=$(git branch --contains ${forkpoint}~ --points-at ${forkpoint}~)
fi

# Find the branch we forked from
forkpoint=$(git merge-base --fork-point HEAD)
curbranch=$(git branch --contains ${forkpoint}~ --points-at ${forkpoint}~)

pushd $(pwd) >/dev/null
cd "${tmpdir}"

Expand Down

0 comments on commit f273563

Please sign in to comment.