@@ -17,8 +17,9 @@ function call()
17
17
function do_clone()
18
18
{
19
19
test -d .git_externals || return 1
20
- module=` echo $remote_url | sed ' s,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\1,' `
21
- branch=` echo $remote_url | sed ' s,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\2,' | sed ' s,^/,,' `
20
+ module=` echo $remote_url | sed ' s,\(.*\)\(/trunk.*\|/branch.*\|/tag.*\),\1,' `
21
+ branch=` echo $remote_url | sed ' s,\(.*\)\(/trunk.*\|/branch.*\|/tag.*\),\2,' | sed ' s,^/,,' `
22
+ suffix=` echo $branch | sed ' s,^\(trunk\|branches\|tags\)\(.*\),\2,' `
22
23
if [[ $branch = $remote_url ]]; then
23
24
branch=" "
24
25
fi
@@ -41,15 +42,15 @@ function do_clone()
41
42
# additional options for git-svn
42
43
call git svn clone " $revision " " $module " " $local_directory "
43
44
else
44
- call git svn clone " $revision " " $module " -T trunk -b $brch -t $tags " $local_directory "
45
+ call git svn clone " $revision " " $module " -T trunk$suffix -b $brch$suffix -t $tags$suffix " $local_directory "
45
46
fi
46
47
47
48
fi
48
49
(
49
50
branch=" $( echo ${branch} | sed ' s,/$,,' ) "
50
51
if [ -n " $branch " ]; then
51
52
cd " $local_directory "
52
- call git reset --hard $branch
53
+ call git reset --hard ` echo $branch | sed " s, $suffix ,, " `
53
54
fi
54
55
)
55
56
)
0 commit comments