]> git.nbdom.net Git - nb.git/commitdiff
etc/profile.d/git.sh
authorroot <sys@15gifts.com>
Fri, 13 Oct 2017 14:24:25 +0000 (15:24 +0100)
committerroot <sys@15gifts.com>
Fri, 13 Oct 2017 14:24:25 +0000 (15:24 +0100)
etc/profile.d/git.sh

index 17a4db23755e42a510134dac0c21c3af7673f2ab..201181b4ff31eac2a90ee64b497821c5d69ae48f 100644 (file)
@@ -169,22 +169,18 @@ git_conn_check() {
   return 0
 }
 
-# NB 26.09.17: TODO 
 git_merge_from() {
   local usage="Usage: git_merge_from BRANCH, but does not push !"
   local from=${1:?$usage}
   local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}')
   [ -z "$branch" ] && echo "$usage" 1>&2 && return 1
-  echo "git checkout $from && git pull && git checkout $branch && git merge $from"
-  return 0
+  eval "git checkout $from && git pull && git checkout $branch && git merge $from"
 }
 
-# NB 26.09.17: TODO 
 git_merge_to() {
   local usage="Usage: git_merge_to BRANCH and auto push branch to !"
   local to=${1:?$usage}
   local branch=$(git branch 2>/dev/null|awk '/^\*/{print $2}')
   [ -z "$branch" ] && echo "$usage" 1>&2 && return 1
-  echo "git checkout $to && git pull && git merge $branch && git push && git checkout $branch"
-  return 0
+  eval "git checkout $to && git pull && git merge $branch && git push && git checkout $branch"
 }