aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-01-15 12:47:59 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-01-15 12:47:59 -0200
commita5e180fe77a7aaccfcbd26aba8ee1c484ef9aad6 (patch)
treee0a86be82089678cc4127e604bcea27b5535a7c2
parent9e844111caa8f4f9fbc69981b49caa4d09d09980 (diff)
downloadscripts-a5e180fe77a7aaccfcbd26aba8ee1c484ef9aad6.tar.gz
scripts-a5e180fe77a7aaccfcbd26aba8ee1c484ef9aad6.tar.bz2
Cleanup and minor fixes at commit script
-rwxr-xr-xcommit26
1 files changed, 3 insertions, 23 deletions
diff --git a/commit b/commit
index a113432..2be27dd 100755
--- 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