diff options
-rw-r--r-- | trunk/lib/common.sh | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh index 275c355..36bbb4a 100644 --- a/trunk/lib/common.sh +++ b/trunk/lib/common.sh @@ -443,18 +443,28 @@ function svn_check { # check if a file is under svn # usage: svn_check <file> - local cwd + local cwd folder cwd="`pwd`" - cd `dirname $1` + folder="`dirname $1`" + + if [ -d "$folder/.svn" ]; then + + cd $folder + + if [ "`svn status $1 | awk '{ print $1 }'`" == "?" ]; then + return 1 + else + return 0 + fi + + cd $cwd - if [ "`svn status $1 | awk '{ print $1 }'`" == "?" ]; then - return 1 else - return 0 - fi - cd $cwd + return 1 + + fi } |