diff options
Diffstat (limited to 'commit')
-rwxr-xr-x | commit | 26 |
1 files changed, 3 insertions, 23 deletions
@@ -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 |