Skip to content

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

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 two parts:

 * 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 v4:

 * got rid of test assertion that shows bug behavior
 * clarified commit message

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 (2):
  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 | 18 +++++++++++-------
 2 files changed, 13 insertions(+), 7 deletions(-)

base-commit: b896f729e240d250cf56899e6a0073f6aa469f5d

Submitted-As: https://lore.kernel.org/git/pull.1226.v5.git.git.1647611643.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
In-Reply-To: https://lore.kernel.org/git/pull.1226.v4.git.git.1647546828.gitgitgadget@gmail.com
Assets 2