From: "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Han-Wen Nienhuys <hanwenn@gmail.com>,
Han-Wen Nienhuys <hanwen@google.com>
Subject: [PATCH 1/2] t3420: prepare for reftable
Date: Tue, 08 Feb 2022 20:09:44 +0000 [thread overview]
Message-ID: <fc1bd0621085f331b804c83df7a03cb1d4872fcd.1644350985.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1214.git.git.1644350985.gitgitgadget@gmail.com>
From: Han-Wen Nienhuys <hanwen@google.com>
Check for autostash existence using rev-parse; remove the autostash
using test-tool.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
t/t3420-rebase-autostash.sh | 31 ++++++++++++++++---------------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh
index 43fcb68f27e..e6466290e03 100755
--- a/t/t3420-rebase-autostash.sh
+++ b/t/t3420-rebase-autostash.sh
@@ -79,7 +79,7 @@ create_expected_failure_merge () {
testrebase () {
type=$1
- dotest=$2
+ test_type=$2
test_expect_success "rebase$type: dirty worktree, --no-autostash" '
test_config rebase.autostash true &&
@@ -133,9 +133,10 @@ testrebase () {
test_when_finished git branch -D rebased-feature-branch &&
echo dirty >>file3 &&
test_must_fail git rebase$type related-onto-branch &&
- test_path_is_file $dotest/autostash &&
+ git rev-parse $test_type/autostash &&
test_path_is_missing file3 &&
- rm -rf $dotest &&
+ test-tool ref-store main delete-refs REF_SKIP_REFNAME_VERIFICATION msg $test_type/autostash &&
+ rm -rf .git/$test_type &&
git reset --hard &&
git checkout feature-branch
'
@@ -147,12 +148,12 @@ testrebase () {
test_when_finished git branch -D rebased-feature-branch &&
echo dirty >>file3 &&
test_must_fail git rebase$type related-onto-branch &&
- test_path_is_file $dotest/autostash &&
+ git rev-parse $test_type/autostash &&
test_path_is_missing file3 &&
echo "conflicting-plus-goodbye" >file2 &&
git add file2 &&
git rebase --continue &&
- test_path_is_missing $dotest/autostash &&
+ test_must_fail git rev-parse $test_type/autostash &&
grep dirty file3 &&
git checkout feature-branch
'
@@ -164,10 +165,10 @@ testrebase () {
test_when_finished git branch -D rebased-feature-branch &&
echo dirty >>file3 &&
test_must_fail git rebase$type related-onto-branch &&
- test_path_is_file $dotest/autostash &&
+ git rev-parse $test_type/autostash &&
test_path_is_missing file3 &&
git rebase --skip &&
- test_path_is_missing $dotest/autostash &&
+ test_must_fail git rev-parse $test_type/autostash &&
grep dirty file3 &&
git checkout feature-branch
'
@@ -179,10 +180,10 @@ testrebase () {
test_when_finished git branch -D rebased-feature-branch &&
echo dirty >>file3 &&
test_must_fail git rebase$type related-onto-branch &&
- test_path_is_file $dotest/autostash &&
+ git rev-parse $test_type/autostash &&
test_path_is_missing file3 &&
git rebase --abort &&
- test_path_is_missing $dotest/autostash &&
+ test_must_fail git rev-parse $test_type/autostash &&
grep dirty file3 &&
git checkout feature-branch
'
@@ -195,11 +196,11 @@ testrebase () {
echo dirty >>file3 &&
git diff >expect &&
test_must_fail git rebase$type related-onto-branch &&
- test_path_is_file $dotest/autostash &&
+ git rev-parse $test_type/autostash &&
test_path_is_missing file3 &&
git rebase --quit &&
test_when_finished git stash drop &&
- test_path_is_missing $dotest/autostash &&
+ test_must_fail git rev-parse $test_type/autostash &&
! grep dirty file3 &&
git stash show -p >actual &&
test_cmp expect actual &&
@@ -214,7 +215,7 @@ testrebase () {
echo dirty >file4 &&
git add file4 &&
git rebase$type unrelated-onto-branch >actual 2>&1 &&
- test_path_is_missing $dotest &&
+ test_must_fail git rev-parse $test_type/autostash &&
git reset --hard &&
grep unrelated file4 &&
! grep dirty file4 &&
@@ -257,9 +258,9 @@ test_expect_success "rebase: noop rebase" '
git checkout feature-branch
'
-testrebase " --apply" .git/rebase-apply
-testrebase " --merge" .git/rebase-merge
-testrebase " --interactive" .git/rebase-merge
+testrebase " --apply" rebase-apply
+testrebase " --merge" rebase-merge
+testrebase " --interactive" rebase-merge
test_expect_success 'abort rebase -i with --autostash' '
test_when_finished "git reset --hard" &&
--
gitgitgadget
next prev parent reply other threads:[~2022-02-08 22:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 20:09 [PATCH 0/2] Prepare (auto)stash for reftable Han-Wen Nienhuys via GitGitGadget
2022-02-08 20:09 ` Han-Wen Nienhuys via GitGitGadget [this message]
2022-02-08 20:09 ` [PATCH 2/2] Treat MERGE_AUTOSTASH and friends as a pseudoref Han-Wen Nienhuys via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fc1bd0621085f331b804c83df7a03cb1d4872fcd.1644350985.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.com \
--cc=hanwenn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.