Commit Diff


commit - f74016d64332a91c71bac8b3ac8dc3f53ca56c7c6640fc44d20655ba09301444
commit + d40159dedb256c4362e29173d0ec51fb840d931dc9ec295e42596cf2616631f6
blob - ad1025f67ad845290a0f53e6c175c42d6c8ccc20e00d0f3829c2ad2ff670299e
blob + 7995b9aa214dda9e60b21adf680a1718b20b84470eeb2791b94059f4b4f69cd9
--- regress/cmdline/checkout.sh	
+++ regress/cmdline/checkout.sh	
@@ -1125,29 +1125,13 @@ test_checkout_tree_with_dot_got() {
 }
 
 test_checkout_bad_tree_entry() {
-	local testroot=`test_init checkout_bad_tree_entry`
+	local testroot=`test_init checkout_bad_tree_entry 1`
 
-	(
-	cd $testroot/repo
+	gotadmin load -q -r $testroot/repo < ./testdata/bad-tree-entry.bundle
+	local commit_id=d52a061702e571487aaa7419511966945f2a23da
+	git -C $testroot/repo update-ref refs/heads/main "$commit_id"
+	git -C $testroot/repo symbolic-ref HEAD refs/heads/main
 
-	entry() {
-		mode="$1"
-		name="$2"
-		sha="$3"
-		printf '%s %s\0' "$mode" "$name"
-		printf '%s' "$sha" | xxd -r -p
-	}
-
-	blob="$(echo 'oh no' | git hash-object -w --stdin)"
-	tree="$(entry 100644 ../pwned "$blob" | git hash-object -w -t tree --stdin --literally)"
-
-	commit="$(echo cursed | git commit-tree "$tree")"
-	git update-ref refs/heads/main "$commit"
-	git symbolic-ref HEAD refs/heads/main
-	)
-
-	local commit_id=`git_show_head $testroot/repo`
-
 	got checkout $testroot/repo $testroot/wt > $testroot/stdout
 	ret=$?
 	if [ $ret -ne 0 ]; then
blob - /dev/null
blob + dbc2aca72f51570c50bd7d90fe9ab017d74fddd0111f3105b44369af8e264221 (mode 644)
Binary files /dev/null and regress/cmdline/testdata/bad-tree-entry.bundle differ