diff options
Diffstat (limited to 'commit')
-rwxr-xr-x | commit | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -6,6 +6,9 @@ # Parameters ARGS="$*" +# Git application we use +GIT="hit" + # Check if a file is inside a git repository # Usage: git_folder <file> function git_folder { @@ -51,7 +54,7 @@ function is_git { elif [ -d "$1/.git" ]; then return else - ( cd "$1" && git status &> /dev/null ) + ( cd "$1" && $GIT status &> /dev/null ) if [ "$?" != "128" ]; then return @@ -77,12 +80,12 @@ function is_svn { function git_push { if [ "`git remote | wc -l`" == "0" ]; then return - elif git remote | grep -q 'all'; then - git push all --all + elif $GIT remote | grep -q 'all'; then + $GIT push all --all #elif git remote | grep -q 'origin'; then # echo "Please configure the 'all' remote first." # exit 1 - # #git push --all + # #$GIT push --all fi } @@ -130,13 +133,13 @@ function git_commit { # If there are no staged files, commit everything. # Otherwise commit just what was staged - if git status --short | grep -q "^[AM]"; then + if $GIT status --short | grep -q "^[AM]"; then flag="" else flag="-a" fi - git commit $flag -m "$params" + $GIT commit $flag -m "$params" } # Main @@ -150,6 +153,6 @@ if [ ! -z "$1" ]; then git_user git_commit $* git_push - git fetch --all + $GIT fetch --all fi fi |