]> gitweb.fluxo.info Git - simplepkg.git/commitdiff
common.sh: small fix on svn_check
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sat, 7 Apr 2007 18:43:00 +0000 (18:43 +0000)
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>
Sat, 7 Apr 2007 18:43:00 +0000 (18:43 +0000)
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@306 04377dda-e619-0410-9926-eae83683ac58

trunk/lib/common.sh

index 275c355d82e9c9aefddad457ce7a2c6614d5ffdb..36bbb4a21fcc935412d5a7af8e6b8ec0a672c63a 100644 (file)
@@ -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
 
 }