@@ -417,9 +417,9 @@ test_wt_add_orphan_hint () {
417
417
grep "hint: If you meant to create a worktree containing a new orphan branch" actual &&
418
418
if [ $use_branch -eq 1 ]
419
419
then
420
- grep -E "^hint:\s +git worktree add --orphan -b \S+ \S+\s* $" actual
420
+ grep -E "^hint: +git worktree add --orphan -b [^ ]+ [^ ]+ $" actual
421
421
else
422
- grep -E "^hint:\s +git worktree add --orphan \S+\s* $" actual
422
+ grep -E "^hint: +git worktree add --orphan [^ ]+ $" actual
423
423
fi
424
424
425
425
'
@@ -709,8 +709,8 @@ test_dwim_orphan () {
709
709
local info_text=" No possible source branch, inferring '--orphan'" &&
710
710
local fetch_error_text=" fatal: No local or remote refs exist despite at least one remote" &&
711
711
local orphan_hint=" hint: If you meant to create a worktree containing a new orphan branch" &&
712
- local invalid_ref_regex=" ^fatal: invalid reference:\s\+.* " &&
713
- local bad_combo_regex=" ^fatal: '[a-z-]\+ ' and '[a-z-]\+ ' cannot be used together" &&
712
+ local invalid_ref_regex=" ^fatal: invalid reference: " &&
713
+ local bad_combo_regex=" ^fatal: '[- a-z]* ' and '[- a-z]* ' cannot be used together" &&
714
714
715
715
local git_ns=" repo" &&
716
716
local dashc_args=" -C $git_ns " &&
@@ -995,11 +995,11 @@ test_dwim_orphan () {
995
995
grep "$invalid_ref_regex" actual &&
996
996
! grep "$orphan_hint" actual
997
997
else
998
- headpath=$(git $dashc_args rev-parse --sq -- path-format=absolute --git-path HEAD) &&
998
+ headpath=$(git $dashc_args rev-parse --path-format=absolute --git-path HEAD) &&
999
999
headcontents=$(cat "$headpath") &&
1000
1000
grep "HEAD points to an invalid (or orphaned) reference" actual &&
1001
- grep "HEAD path:\s* .$headpath." actual &&
1002
- grep "HEAD contents:\s* .$headcontents." actual &&
1001
+ grep "HEAD path: .$headpath." actual &&
1002
+ grep "HEAD contents: .$headcontents." actual &&
1003
1003
grep "$orphan_hint" actual &&
1004
1004
! grep "$info_text" actual
1005
1005
fi &&
0 commit comments