mbox series

[v4,0/2] worktree add: sanitize worktree names

Message ID 20190305120834.7284-1-pclouds@gmail.com (mailing list archive)
Headers show
Series worktree add: sanitize worktree names | expand

Message

Duy Nguyen March 5, 2019, 12:08 p.m. UTC
v4 refactors check_refname_component() so that we could do more accurate
substitution (and leave fewer traps).

Performance of sanitize_worktree_refname() goes back to horrible
again. But since it's not really a big deal (no body is going to add
200 worktrees per second), I don't feel like we should optimize it.
That may involve removing the for loop in do_check_refname_component()
and making things uglier.

The test is also updated to have FUNNYNAMES prerequisite, which is
always unset on Windows. This should fix the breakage there.

Nguyễn Thái Ngọc Duy (2):
  refs.c: refactor check_refname_component()
  worktree add: sanitize worktree names

 builtin/worktree.c      |   7 ++-
 refs.c                  | 114 ++++++++++++++++++++++++++++++++++------
 refs.h                  |   1 +
 t/t2025-worktree-add.sh |   5 ++
 4 files changed, 110 insertions(+), 17 deletions(-)