X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft3210-pack-refs.sh;h=413019acafc98646a61e77960527f042a8f96ac6;hb=f8aa1b6902d7a77c26b0ef615c9070bbed4be5c4;hp=4ddc6342a94b9e7b39153cf5ac93ae3c3fb3c31e;hpb=891e85a0c08e12d3f6174d8eb10b4ef284c4b01b;p=git.git diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh index 4ddc6342a..413019aca 100755 --- a/t/t3210-pack-refs.sh +++ b/t/t3210-pack-refs.sh @@ -17,7 +17,7 @@ test_expect_success \ 'prepare a trivial repository' \ 'echo Hello > A && git update-index --add A && - git-commit -m "Initial commit." && + git commit -m "Initial commit." && HEAD=$(git rev-parse --verify HEAD)' SHA1= @@ -39,12 +39,12 @@ test_expect_success \ git show-ref b >result && diff expect result' -test_expect_failure \ - 'git branch c/d should barf if branch c exists' \ - 'git branch c && +test_expect_success 'git branch c/d should barf if branch c exists' ' + git branch c && git pack-refs --all && - rm .git/refs/heads/c && - git branch c/d' + rm -f .git/refs/heads/c && + test_must_fail git branch c/d +' test_expect_success \ 'see if a branch still exists after git pack-refs --prune' \ @@ -54,11 +54,11 @@ test_expect_success \ git show-ref e >result && diff expect result' -test_expect_failure \ - 'see if git pack-refs --prune remove ref files' \ - 'git branch f && +test_expect_success 'see if git pack-refs --prune remove ref files' ' + git branch f && git pack-refs --all --prune && - ls .git/refs/heads/f' + ! test -f .git/refs/heads/f +' test_expect_success \ 'git branch g should work when git branch g/h has been deleted' \ @@ -69,11 +69,11 @@ test_expect_success \ git pack-refs --all && git branch -d g' -test_expect_failure \ - 'git branch i/j/k should barf if branch i exists' \ - 'git branch i && +test_expect_success 'git branch i/j/k should barf if branch i exists' ' + git branch i && git pack-refs --all --prune && - git branch i/j/k' + test_must_fail git branch i/j/k +' test_expect_success \ 'test git branch k after branch k/l/m and k/lm have been deleted' \ @@ -96,8 +96,15 @@ test_expect_success \ git branch -d n/o/p && git branch n' +test_expect_success \ + 'see if up-to-date packed refs are preserved' \ + 'git branch q && + git pack-refs --all --prune && + git update-ref refs/heads/q refs/heads/q && + ! test -f .git/refs/heads/q' + test_expect_success 'pack, prune and repack' ' - git-tag foo && + git tag foo && git pack-refs --all --prune && git show-ref >all-of-them && git pack-refs &&