Skip to content

pr-git-1226/john-cai/jc/fix-rebase-oids-v4

Fixes a bug [1] reported by Michael McClimon where rebase with oids will
erroneously update the branch HEAD points to.

 1. https://lore.kernel.org/git/xmqqsfrpbepd.fsf@gitster.g/

This patch has three parts:

 * a test to show the incorrect buggy behavior of rebase with a non-branch
   argument
 * updates rebase setup test to add some tags we will use, while swapping
   out manual commit creation with the test_commit helper
 * sets RESET_HARD_DETACH flag if branch is not a valid refname

changes since v3:

 * fixed typos in commit message
 * added a test assertion to show bug behavior
 * included more replacements with test_commit

changes since v2:

 * remove BUG assertion

changes since v1:

 * only set RESET_HEAD_DETACH if is not a valid branch
 * updated tests to use existing setup

John Cai (3):
  rebase: test showing bug in rebase with non-branch
  rebase: use test_commit helper in setup
  rebase: set REF_HEAD_DETACH in checkout_up_to_date()

 builtin/rebase.c  |  2 ++
 t/t3400-rebase.sh | 27 +++++++++++++--------------
 2 files changed, 15 insertions(+), 14 deletions(-)

base-commit: b896f729e240d250cf56899e6a0073f6aa469f5d

Submitted-As: https://lore.kernel.org/git/pull.1226.v4.git.git.1647546828.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1226.git.git.1646975144178.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1226.v2.git.git.1647019492.gitgitgadget@gmail.com
In-Reply-To: https://lore.kernel.org/git/pull.1226.v3.git.git.1647487001.gitgitgadget@gmail.com
Assets 2