Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-06-21 01:53:12 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-21 01:53:12 +0300
commit208a28ec08bc472cdc54fcc2bbdb0179f626ab3d (patch)
tree0f2ba69b1a9edfa3d1c684adcc8b7d573e97e649 /t/t3210-pack-refs.sh
parent6069c1a5a7631deeec550d85c19ebd004c134ea5 (diff)
parent3b8724bce65edea7abba480929457ef794ec753e (diff)
Merge branch 'jc/test-modernization'
* jc/test-modernization: t7101-reset-empty-subdirs: modernize test format t6050-replace: modernize test format t5306-pack-nobase: modernize test format t5303-pack-corruption-resilience: modernize test format t5301-sliding-window: modernize test format t5300-pack-object: modernize test format t4206-log-follow-harder-copies: modernize test format t4202-log: modernize test format t4004-diff-rename-symlink: modernize test format t4003-diff-rename-1: modernize test format t4002-diff-basic: modernize test format t3903-stash: modernize test format t3700-add: modernize test format t3500-cherry: modernize test format t1006-cat-file: modernize test format t1002-read-tree-m-u-2way: modernize test format t1001-read-tree-m-2way: modernize test format t3210-pack-refs: modernize test format t0030-stripspace: modernize test format t0000-basic: modernize test format
Diffstat (limited to 't/t3210-pack-refs.sh')
-rwxr-xr-xt/t3210-pack-refs.sh152
1 files changed, 76 insertions, 76 deletions
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index 9f399d2f75..7326adb70f 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -19,94 +19,94 @@ test_expect_success 'enable reflogs' '
git config core.logallrefupdates true
'
-test_expect_success \
- 'prepare a trivial repository' \
- 'echo Hello > A &&
- git update-index --add A &&
- git commit -m "Initial commit." &&
- HEAD=$(git rev-parse --verify HEAD)'
+test_expect_success 'prepare a trivial repository' '
+ echo Hello > A &&
+ git update-index --add A &&
+ git commit -m "Initial commit." &&
+ HEAD=$(git rev-parse --verify HEAD)
+'
SHA1=
-test_expect_success \
- 'see if git show-ref works as expected' \
- 'git branch a &&
- SHA1=$(cat .git/refs/heads/a) &&
- echo "$SHA1 refs/heads/a" >expect &&
- git show-ref a >result &&
- test_cmp expect result'
-
-test_expect_success \
- 'see if a branch still exists when packed' \
- 'git branch b &&
- git pack-refs --all &&
- rm -f .git/refs/heads/b &&
- echo "$SHA1 refs/heads/b" >expect &&
- git show-ref b >result &&
- test_cmp expect result'
+test_expect_success 'see if git show-ref works as expected' '
+ git branch a &&
+ SHA1=$(cat .git/refs/heads/a) &&
+ echo "$SHA1 refs/heads/a" >expect &&
+ git show-ref a >result &&
+ test_cmp expect result
+'
+
+test_expect_success 'see if a branch still exists when packed' '
+ git branch b &&
+ git pack-refs --all &&
+ rm -f .git/refs/heads/b &&
+ echo "$SHA1 refs/heads/b" >expect &&
+ git show-ref b >result &&
+ test_cmp expect result
+'
test_expect_success 'git branch c/d should barf if branch c exists' '
- git branch c &&
- git pack-refs --all &&
- rm -f .git/refs/heads/c &&
- test_must_fail git branch c/d
+ git branch c &&
+ git pack-refs --all &&
+ 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' \
- 'git branch e &&
- git pack-refs --all --prune &&
- echo "$SHA1 refs/heads/e" >expect &&
- git show-ref e >result &&
- test_cmp expect result'
+test_expect_success 'see if a branch still exists after git pack-refs --prune' '
+ git branch e &&
+ git pack-refs --all --prune &&
+ echo "$SHA1 refs/heads/e" >expect &&
+ git show-ref e >result &&
+ test_cmp expect result
+'
test_expect_success 'see if git pack-refs --prune remove ref files' '
- git branch f &&
- git pack-refs --all --prune &&
- ! test -f .git/refs/heads/f
+ git branch f &&
+ git pack-refs --all --prune &&
+ ! test -f .git/refs/heads/f
'
test_expect_success 'see if git pack-refs --prune removes empty dirs' '
- git branch r/s/t &&
- git pack-refs --all --prune &&
- ! test -e .git/refs/heads/r
+ git branch r/s/t &&
+ git pack-refs --all --prune &&
+ ! test -e .git/refs/heads/r
'
-test_expect_success \
- 'git branch g should work when git branch g/h has been deleted' \
- 'git branch g/h &&
- git pack-refs --all --prune &&
- git branch -d g/h &&
- git branch g &&
- git pack-refs --all &&
- git branch -d g'
+test_expect_success 'git branch g should work when git branch g/h has been deleted' '
+ git branch g/h &&
+ git pack-refs --all --prune &&
+ git branch -d g/h &&
+ git branch g &&
+ git pack-refs --all &&
+ git branch -d g
+'
test_expect_success 'git branch i/j/k should barf if branch i exists' '
- git branch i &&
- git pack-refs --all --prune &&
- test_must_fail git branch i/j/k
+ git branch i &&
+ git pack-refs --all --prune &&
+ 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' '
+ git branch k/l &&
+ git branch k/lm &&
+ git branch -d k/l &&
+ git branch k/l/m &&
+ git branch -d k/l/m &&
+ git branch -d k/lm &&
+ git branch k
'
-test_expect_success \
- 'test git branch k after branch k/l/m and k/lm have been deleted' \
- 'git branch k/l &&
- git branch k/lm &&
- git branch -d k/l &&
- git branch k/l/m &&
- git branch -d k/l/m &&
- git branch -d k/lm &&
- git branch k'
-
-test_expect_success \
- 'test git branch n after some branch deletion and pruning' \
- 'git branch n/o &&
- git branch n/op &&
- git branch -d n/o &&
- git branch n/o/p &&
- git branch -d n/op &&
- git pack-refs --all --prune &&
- git branch -d n/o/p &&
- git branch n'
+test_expect_success 'test git branch n after some branch deletion and pruning' '
+ git branch n/o &&
+ git branch n/op &&
+ git branch -d n/o &&
+ git branch n/o/p &&
+ git branch -d n/op &&
+ git pack-refs --all --prune &&
+ git branch -d n/o/p &&
+ git branch n
+'
test_expect_success 'test excluded refs are not packed' '
git branch dont_pack1 &&
@@ -145,12 +145,12 @@ test_expect_success 'test --exclude takes precedence over --include' '
git pack-refs --include "refs/heads/pack*" --exclude "refs/heads/pack*" &&
test -f .git/refs/heads/dont_pack5'
-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 '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 &&