diff options
Diffstat (limited to 'SOURCE/CORE/git.sh')
| -rw-r--r-- | SOURCE/CORE/git.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/SOURCE/CORE/git.sh b/SOURCE/CORE/git.sh index 42c89a8..7be650f 100644 --- a/SOURCE/CORE/git.sh +++ b/SOURCE/CORE/git.sh @@ -19,7 +19,7 @@ is_git_repo() { # accepts -f parameter to skip last sync check gitsync() { FORCE=$1 - if [[ $USEGIT && -n $GITREMOTE ]]; then + if [[ $USEGIT == true && -n $GITREMOTE ]]; then [ $PLAIN == false ] && echo "Syncing notes with git on remote \"$GITREMOTE\"" NOWSYNC=$(date +%s) if [[ $FORCE == "-f" ]]; then @@ -50,12 +50,12 @@ gitsync() { # add note to git and push it to remote gitadd() { - if [[ $USEGIT && -n $GITREMOTE ]]; then + if [[ $USEGIT == true && -n $GITREMOTE ]]; then [ $PLAIN == false ] && echo "Adding note to remote \"$GITREMOTE\"" cd $BASEDIR $GIT add . $GIT commit -m "$(basename $0) - adding note from ${GITCLIENT}" - $GIT push origin master + $GIT push origin HEAD else # no git, so we just keep going true @@ -64,12 +64,12 @@ gitadd() { # edited note added to git and pushed it to remote gitedit() { - if [[ $USEGIT && -n $GITREMOTE ]]; then + if [[ $USEGIT == true && -n $GITREMOTE ]]; then [ $PLAIN == false ] && echo "Editing note on remote \"$GITREMOTE\"" cd $BASEDIR $GIT add . $GIT commit -m "$(basename $0) - ${GITCLIENT} note edited." - $GIT push origin master + $GIT push origin HEAD else # no git, so we just keep going true @@ -80,14 +80,14 @@ gitedit() { gitremove() { NOTE=$1 FILE=$2 - if [[ $USEGIT && -n $GITREMOTE ]]; then + if [[ $USEGIT == true && -n $GITREMOTE ]]; then [ $PLAIN == false ] && echo "Deleting notes from remote \"$GITREMOTE\"" if [ "all" == $NOTE ];then echo "Deleting all notes" cd $BASEDIR $GIT rm notes/* $GIT commit -m "$(basename $0) - ${GITCLIENT} removing all notes." - $GIT push origin master + $GIT push origin HEAD else local OK=$(check_noteID "$NOTE") if [[ "$OK" ]]; then @@ -96,7 +96,7 @@ gitremove() { $GIT rm notes/${FILE} $GIT add . $GIT commit -m "$(basename $0) - ${GITCLIENT} removing note ID ${NOTE}." - $GIT push origin master + $GIT push origin HEAD fi fi else @@ -106,7 +106,7 @@ gitremove() { } # check for USEGIT and subsequent variables -if [[ $USEGIT && -n $GITREMOTE ]]; then +if [[ $USEGIT == true && -n $GITREMOTE ]]; then # GIT is a go. if ! is_git_repo $BASEDIR; then # initializing git repository @@ -116,9 +116,9 @@ if [[ $USEGIT && -n $GITREMOTE ]]; then $GIT add . $GIT commit -m "$(basename $0) - initial commit from ${GITCLIENT}" $GIT remote add origin $GITREMOTE - $GIT push -u origin master + $GIT push -u origin HEAD fi -elif [[ $USEGIT && -z $GITREMOTE ]]; then +elif [[ $USEGIT == true && -z $GITREMOTE ]]; then echo "GITREMOTE variable not set. reverting USEGIT to false" USEGIT=false fi |
