From c6e9506edfc7c1f8ed7a8eb68064aa4f09dbd730 Mon Sep 17 00:00:00 2001 From: kprkpr Date: Thu, 30 Jun 2016 16:20:34 +0200 Subject: [PATCH] Changed form of change branch --- jka-toolkit/gitdit | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/jka-toolkit/gitdit b/jka-toolkit/gitdit index 3ac39b9..ff557f4 100755 --- a/jka-toolkit/gitdit +++ b/jka-toolkit/gitdit @@ -8,7 +8,7 @@ preOption=$(git status 2>/dev/stdout | sed -n 1p | cut -f2 -d" ") if [ $preOption = "Not" ];then #When it isn't only it can do git clone gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 c "Descargar un nuevo repo (Hacer clone)" i "Inicializar nuevo repo"` else #Else, all other options - gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de rama " u "Cambiar de rama y actualizar" m "Unir ramas (Hacer merge)"` + gitopt=`dialog --stdout --scrollbar --menu "gitdit - Git DIalog inTerface" 0 0 6 p "Descargar actualizaciones del git (Hacer pull)" t "Confirmar cambios sin subida" s "Subir actualizaciones al git (Hacer push)" n "Crear nueva rama" b "Cambiar de rama " m "Unir ramas (Hacer merge)"` actual="origin $(git branch --list | grep "^*" | cut -f2 -d" ")" #Current branch actual2=$(git branch --list | grep "^*" | cut -f2 -d" ") #Current branch name fi @@ -65,7 +65,11 @@ if [ ! -z $gitopt ];then #No canceled fi git add . && git commit -m "$commit" ;; - "b" | "u") + "b") + howopt=`dialog --stdout --scrollbar --menu "Cambiar de rama" 0 0 6 c "Solo cambiar de rama" u "Cambiar de rama y actualizarla"` + if [ -z $howopt ];then + exit + fi j=0 rama="" #Loop to create dialog whith all branches (except the current) @@ -97,7 +101,7 @@ if [ ! -z $gitopt ];then #No canceled ramificacion=`dialog --stdout --scrollbar --menu "Selecione la rama a saltar" 0 0 6 $rama` if [ ! -z $ramificacion ];then git checkout ${lista[$ramificacion]} - if [ $gitopt = "u" ];then + if [ $howopt = "u" ];then git pull origin ${lista[$ramificacion]} fi fi