diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-01-29 00:45:39 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-01-29 00:45:52 (GMT) |
commit | f120b65cd41c0e93432af1a36c82fd3a8d39ccd4 (patch) | |
tree | 0657b197543b8eedd733aac032e9587c25d0a614 /t | |
parent | 89bece5c8c96f0b962cfc89e63f82d603fd60bed (diff) | |
parent | ff5b7913f0af62c26682b0376d0aa2d7f5d74b2e (diff) | |
download | git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.zip git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.tar.gz git-f120b65cd41c0e93432af1a36c82fd3a8d39ccd4.tar.bz2 |
Merge branch 'en/keep-cwd' into maint
Fix a regression in 2.35 that roke the use of "rebase" and "stash"
in a secondary worktree.
* en/keep-cwd:
sequencer, stash: fix running from worktree subdir
Diffstat (limited to 't')
-rwxr-xr-x | t/t3400-rebase.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh index 23dbd3c..71b1735 100755 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@ -416,4 +416,25 @@ test_expect_success MINGW,SYMLINKS_WINDOWS 'rebase when .git/logs is a symlink' mv actual_logs .git/logs ' +test_expect_success 'rebase when inside worktree subdirectory' ' + git init main-wt && + ( + cd main-wt && + git commit --allow-empty -m "initial" && + mkdir -p foo/bar && + test_commit foo/bar/baz && + mkdir -p a/b && + test_commit a/b/c && + # create another branch for our other worktree + git branch other && + git worktree add ../other-wt other && + cd ../other-wt && + # create and cd into a subdirectory + mkdir -p random/dir && + cd random/dir && + # now do the rebase + git rebase --onto HEAD^^ HEAD^ # drops the HEAD^ commit + ) +' + test_done |