Add support for ASIS and AWS
[git-scripts.git] / git-svn-create-dirs
blobd023881f5360f5fe5d996fb86d70c6c3b1ca6722
1 #! /bin/sh
3 # Look for the Git root directory
4 ROOT=`pwd`
5 while [ ! "$ROOT" = "" -a ! -d $ROOT/.git ]; do
6 cd ..
7 ROOT=`pwd`
8 done
10 if [ ! -f .git/config ]; then
11 echo Must be run inside a Git repository
12 fi;
14 FS=" ="
15 svnrepo=`awk '$1=="[svn-remote"{GET=1} \
16 $1=="url" && GET==1 {print $3}' .git/config`
18 echo Looking for empty directories from $svnrepo
20 FILE=/tmp/files-$$
22 svn list -R $svnrepo > $FILE
24 while read entry
26 if [ "${entry: -1:1}" == "/" ]; then
27 if [ ! -d "$entry" ]; then
28 echo create $entry
29 mkdir -p $entry
32 done < $FILE
34 rm -f $FILE