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>2014-09-27 01:39:43 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-27 01:39:43 +0400
commit9bc4222746a09d57998903dab0361b1d7adc271f (patch)
tree5f20a43b111398ee507568e92296697e03a1392e /t/t3210-pack-refs.sh
parent69a5bbbbfa2c659e819228c5e3cd5caa1d7f9a0b (diff)
parentcbe73331812ed0ac3c3b680ab3aab4e6d22a98ad (diff)
Merge branch 'jk/faster-name-conflicts'
Optimize the check to see if a ref $F can be created by making sure no existing ref has $F/ as its prefix, which especially matters in a repository with a large number of existing refs. * jk/faster-name-conflicts: refs: speed up is_refname_available
Diffstat (limited to 't/t3210-pack-refs.sh')
-rwxr-xr-xt/t3210-pack-refs.sh31
1 files changed, 30 insertions, 1 deletions
diff --git a/t/t3210-pack-refs.sh b/t/t3210-pack-refs.sh
index 3a017bf437..aa9eb3a3e5 100755
--- a/t/t3210-pack-refs.sh
+++ b/t/t3210-pack-refs.sh
@@ -11,7 +11,9 @@ semantic is still the same.
'
. ./test-lib.sh
-echo '[core] logallrefupdates = true' >>.git/config
+test_expect_success 'enable reflogs' '
+ git config core.logallrefupdates true
+'
test_expect_success \
'prepare a trivial repository' \
@@ -158,4 +160,31 @@ test_expect_success 'pack ref directly below refs/' '
test_path_is_missing .git/refs/top
'
+test_expect_success 'disable reflogs' '
+ git config core.logallrefupdates false &&
+ rm -rf .git/logs
+'
+
+test_expect_success 'create packed foo/bar/baz branch' '
+ git branch foo/bar/baz &&
+ git pack-refs --all --prune &&
+ test_path_is_missing .git/refs/heads/foo/bar/baz &&
+ test_path_is_missing .git/logs/refs/heads/foo/bar/baz
+'
+
+test_expect_success 'notice d/f conflict with existing directory' '
+ test_must_fail git branch foo &&
+ test_must_fail git branch foo/bar
+'
+
+test_expect_success 'existing directory reports concrete ref' '
+ test_must_fail git branch foo 2>stderr &&
+ grep refs/heads/foo/bar/baz stderr
+'
+
+test_expect_success 'notice d/f conflict with existing ref' '
+ test_must_fail git branch foo/bar/baz/extra &&
+ test_must_fail git branch foo/bar/baz/lots/of/extra/components
+'
+
test_done