Skip to content

Commit

Permalink
linearize: fixed comment
Browse files Browse the repository at this point in the history
  • Loading branch information
feefladder committed Oct 6, 2023
1 parent 0000063 commit 9663fd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 1 addition & 2 deletions git-linearize
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ function cmd_linearize() {
if $EL_REBASE_SPLITS; then
# https://stackoverflow.com/a/46243464/14681457
if [[ -n "${split_commit_map[$sha1]+unset}" ]]; then
# List all branches that share this commit
# Then loop through them and rebase them onto the new commit.
# rebase the branch onto the new commit
branch=${split_commit_map[$sha1]}
git switch $branch | debug
git rebase --onto $new_sha $sha1 | debug
Expand Down
8 changes: 7 additions & 1 deletion testytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ make_dummy_commit
# a-b-e-f main
# \
# c-d new-branch
run_git_linearize "-v --short"
run_git_linearize "--short"
# 0-1-2 main
# a-c-d new-branch
# git switch new-branch
Expand All @@ -29,4 +29,10 @@ else
echo "nay! $(git merge-base main new-branch)"
fi

if [[ $(git merge-base main branch-2) == 000002* ]]; then
echo "yay!"
else
echo "nay! $(git merge-base main new-branch)"
fi

git log --graph --all

0 comments on commit 9663fd9

Please sign in to comment.