3 # Copyright (c) 2005 Junio C Hamano
6 test_description
='See why rewinding head breaks send-pack
12 test_expect_success setup
'
13 tree=$(git-write-tree) &&
14 commit=$(echo "Commit #0" | git-commit-tree $tree) &&
20 commit=$(echo "Commit #$i" | git-commit-tree $tree -p $parent) &&
21 parent=$commit || exit
23 echo "$commit" >.git/HEAD &&
24 git clone -l ./. victim &&
28 echo $zero >.git/HEAD &&
33 commit=$(echo "Rebase #$i" | git-commit-tree $tree -p $parent) &&
34 parent=$commit || exit
36 echo "$commit" >.git/HEAD &&
41 'pushing rewound head should not barf but require --force' '
42 # should not fail but refuse to update.
43 git-send-pack ./victim/.git/ master &&
44 if cmp victim/.git/refs/heads/master .git/refs/heads/master
46 # should have been left as it was!
52 git-send-pack --force ./victim/.git/ master &&
53 cmp victim/.git/refs/heads/master .git/refs/heads/master