summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-06-13 13:19:40 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-06-13 13:19:40 -0700
commit0d107b19890db191c9281bff67180389fb53df24 (patch)
treed61a6fbd1e41b07107b7a686402c92f5283f7670 /t
parentMerge branch 'en/fast-export-encoding' (diff)
parentworktree add: sanitize worktree names (diff)
downloadtgif-0d107b19890db191c9281bff67180389fb53df24.tar.xz
Merge branch 'nd/worktree-name-sanitization'
In recent versions of Git, per-worktree refs are exposed in refs/worktrees/<wtname>/ hierarchy, which means that worktree names must be a valid refname component. The code now sanitizes the names given to worktrees, to make sure these refs are well-formed. * nd/worktree-name-sanitization: worktree add: sanitize worktree names
Diffstat (limited to 't')
-rwxr-xr-xt/t2400-worktree-add.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh
index 286bba35d8..c989dbe321 100755
--- a/t/t2400-worktree-add.sh
+++ b/t/t2400-worktree-add.sh
@@ -570,4 +570,9 @@ test_expect_success '"add" an existing locked but missing worktree' '
git worktree add --force --force --detach gnoo
'
+test_expect_success FUNNYNAMES 'sanitize generated worktree name' '
+ git worktree add --detach ". weird*..?.lock.lock" &&
+ test -d .git/worktrees/---weird-.-
+'
+
test_done