]> gitweb.fluxo.info Git - scripts.git/commitdiff
Cleanup and minor fixes at commit script
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 15 Jan 2013 14:47:59 +0000 (12:47 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 15 Jan 2013 14:47:59 +0000 (12:47 -0200)
commit

diff --git a/commit b/commit
index a113432fd486ea51171bb99c1d54308da6640b3e..2be27dd3a38c81f8ccb7212e136dc0e7a4edb06b 100755 (executable)
--- a/commit
+++ b/commit
@@ -3,30 +3,11 @@
 # Commit both on git and svn
 #
 
-# Get the absolute folder from a file
-# Usage: absolute_folder <file>
-function absolute_folder {
-
-  local file="$1" cwd
-
-  if [ -e "$file" ]; then
-    cwd="`pwd`"
-    cd `dirname $file`
-    pwd
-    cd $cwd
-  fi
-
-}
-
 # Check if a file is inside a git repository
 # Usage: git_folder <file>
 function git_folder {
 
-  local file="$1" folder folders dir_list cwd
-
-  if [ -e "$file" ]; then
-    folder="`absolute_folder $file`"
-  fi
+  local folder="$1" folder folders dir_list cwd
 
   if [ -d "$folder/.git" ]; then
     GIT_FOLDER="$folder"
@@ -42,13 +23,12 @@ function git_folder {
   cwd="`pwd`"
   cd $folder
 
-echo folders: $folders
   for i in $folders; do
     cd ..
     if [ -d "$(pwd)/.git" ]; then
-      cd $cwd
       GIT_FOLDER="$(pwd)"
-      return true
+      cd $cwd
+      return
     fi
   done