File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -666,9 +666,22 @@ sub cmd_branch {
666
666
}
667
667
}
668
668
unless (defined $glob ) {
669
- die " Unknown " ,
670
- $_tag ? " tag" : " branch" ,
671
- " destination $_branch_dest\n " ;
669
+ my $dest_re = qr /\b\Q $_branch_dest\E\b / ;
670
+ foreach my $g (@{$allglobs }) {
671
+ $g -> {path }-> {left } =~ / $dest_re / or next ;
672
+ if (defined $glob ) {
673
+ die " Ambiguous destination: " ,
674
+ $_branch_dest, " \n matches both '" ,
675
+ $glob -> {path }-> {left }, " ' and '" ,
676
+ $g -> {path }-> {left }, " '\n " ;
677
+ }
678
+ $glob = $g ;
679
+ }
680
+ unless (defined $glob ) {
681
+ die " Unknown " ,
682
+ $_tag ? " tag" : " branch" ,
683
+ " destination $_branch_dest\n " ;
684
+ }
672
685
}
673
686
}
674
687
my ($lft , $rgt ) = @{ $glob -> {path } }{qw/ left right/ };
Original file line number Diff line number Diff line change @@ -99,22 +99,22 @@ test_expect_success 'Multiple branch or tag paths require -d' '
99
99
100
100
test_expect_success ' create new branches and tags' '
101
101
( cd git_project &&
102
- git svn branch -m "New branch 1" -d project/ b_one New1 ) &&
102
+ git svn branch -m "New branch 1" -d b_one New1 ) &&
103
103
( cd svn_project &&
104
104
svn_cmd up && test -e b_one/New1/a.file ) &&
105
105
106
106
( cd git_project &&
107
- git svn branch -m "New branch 2" -d project/ b_two New2 ) &&
107
+ git svn branch -m "New branch 2" -d b_two New2 ) &&
108
108
( cd svn_project &&
109
109
svn_cmd up && test -e b_two/New2/a.file ) &&
110
110
111
111
( cd git_project &&
112
- git svn branch -t -m "New tag 1" -d project/ tags_A Tag1 ) &&
112
+ git svn branch -t -m "New tag 1" -d tags_A Tag1 ) &&
113
113
( cd svn_project &&
114
114
svn_cmd up && test -e tags_A/Tag1/a.file ) &&
115
115
116
116
( cd git_project &&
117
- git svn tag -m "New tag 2" -d project/ tags_B Tag2 ) &&
117
+ git svn tag -m "New tag 2" -d tags_B Tag2 ) &&
118
118
( cd svn_project &&
119
119
svn_cmd up && test -e tags_B/Tag2/a.file )
120
120
'
You can’t perform that action at this time.
0 commit comments