Skip to content

Commit 7bbc458

Browse files
mackylegitster
authored andcommitted
t9117: use --prefix "" instead of --prefix=""
Versions of Perl's Getopt::Long module before 2.37 do not contain this fix that first appeared in Getopt::Long version 2.37: * Bugfix: With gnu_compat, --foo= will no longer trigger "Option requires an argument" but return the empty string. Instead of using --prefix="" use --prefix "" when testing an explictly empty prefix string in order to work with older versions of Perl's Getopt::Long module. Also add a paragraph on this workaround to the documentation of git-svn itself. Signed-off-by: Kyle J. McKay <[email protected]> Acked-by: Johan Herland <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 779792a commit 7bbc458

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Documentation/git-svn.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ COMMANDS
9191
NOTE: Before Git v2.0, the default prefix was "" (no prefix). This
9292
meant that SVN-tracking refs were put at "refs/remotes/*", which is
9393
incompatible with how Git's own remote-tracking refs are organized.
94+
If you still want the old default, you can get it by passing
95+
`--prefix ""` on the command line (`--prefix=""` may not work if
96+
your Perl's Getopt::Long is < v2.37).
9497

9598
--ignore-paths=<regex>;;
9699
When passed to 'init' or 'clone' this regular expression will

t/t9117-git-svn-init-clone.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,18 +101,18 @@ test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
101101
rm -f warning
102102
'
103103

104-
test_expect_success 'init with -s/-T/-b/-t and --prefix="" still works' '
104+
test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
105105
test ! -d project &&
106-
git svn init -s "$svnrepo"/project project --prefix="" 2>warning &&
106+
git svn init -s "$svnrepo"/project project --prefix "" 2>warning &&
107107
test_must_fail grep -q prefix warning &&
108108
test_svn_configured_prefix "" &&
109109
rm -rf project &&
110110
rm -f warning
111111
'
112112

113-
test_expect_success 'clone with -s/-T/-b/-t and --prefix="" still works' '
113+
test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
114114
test ! -d project &&
115-
git svn clone -s "$svnrepo"/project --prefix="" 2>warning &&
115+
git svn clone -s "$svnrepo"/project --prefix "" 2>warning &&
116116
test_must_fail grep -q prefix warning &&
117117
test_svn_configured_prefix "" &&
118118
rm -rf project &&

0 commit comments

Comments
 (0)