Skip to content

Commit 2cf9f0f

Browse files
hanwengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe14431 commit 2cf9f0f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

t/t7064-wtstatus-pv2.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,7 @@ test_expect_success 'verify upstream fields in branch header' '
373373
374374
## Test upstream-gone case. Fake this by pointing
375375
## origin/initial-branch at a non-existing commit.
376-
OLD=$(git rev-parse origin/initial-branch) &&
377-
NEW=$ZERO_OID &&
378-
mv .git/packed-refs .git/old-packed-refs &&
379-
sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs &&
376+
git update-ref -d refs/remotes/origin/initial-branch &&
380377
381378
HUF=$(git rev-parse HEAD) &&
382379

0 commit comments

Comments
 (0)