diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-08-02 16:53:34 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-02 13:17:21 -0700 |
commit | 2cf9f0fca1ad0fedb88f63f59b311b4d80b28f0e (patch) | |
tree | 396072dcb57aac341560e095f8ea1f0f3a3321dd | |
parent | fe1443152689fcecbbaf0213a7bebcc23ee24a37 (diff) | |
download | git-2cf9f0fca1ad0fedb88f63f59b311b4d80b28f0e.tar.gz |
t7064: use update-ref -d to remove upstream branch
The previous code tested this by writing $ZERO_OID explicitly in the packed-refs
file. This is a type of corruption that doesn't reflect realistic use-cases. In
addition, even the ref-store test-tool refuses to write invalid OIDs.
(update-ref interprets $ZERO_OID is deleting the ref).
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | t/t7064-wtstatus-pv2.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh index 4613882caf..eeb0534163 100755 --- a/t/t7064-wtstatus-pv2.sh +++ b/t/t7064-wtstatus-pv2.sh @@ -373,10 +373,7 @@ test_expect_success 'verify upstream fields in branch header' ' ## Test upstream-gone case. Fake this by pointing ## origin/initial-branch at a non-existing commit. - OLD=$(git rev-parse origin/initial-branch) && - NEW=$ZERO_OID && - mv .git/packed-refs .git/old-packed-refs && - sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs && + git update-ref -d refs/remotes/origin/initial-branch && HUF=$(git rev-parse HEAD) && |