Skip to content

Commit 34cb51c

Browse files
committed
Added workaround for cases when there are no trunk/branch/tag in SVN URL.
1 parent 14f1c18 commit 34cb51c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

git-svn-clone-externals

+8-3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ function do_clone()
1919
test -d .git_externals || return 1
2020
module=`echo $remote_url|sed 's,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\1,'`
2121
branch=`echo $remote_url|sed 's,\(.*\)\(/trunk\|/branch.*\|/tag.*\),\2,'|sed 's,^/,,'`
22+
if [[ $branch = $remote_url ]]; then
23+
branch=""
24+
fi
2225
(
2326
cd .git_externals
2427
if [ -d "$local_directory" ]; then
@@ -42,9 +45,11 @@ function do_clone()
4245

4346
fi
4447
(
45-
branch="$(echo ${branch}|sed 's,/$,,')"
46-
cd "$local_directory"
47-
call git reset --hard $branch
48+
branch="$(echo ${branch}|sed 's,/$,,')"
49+
if [ -n "$branch" ]; then
50+
cd "$local_directory"
51+
call git reset --hard $branch
52+
fi
4853
)
4954
)
5055
}

0 commit comments

Comments
 (0)