From 54aa247e8e0140482ceb61785403b04a08e117f7 Mon Sep 17 00:00:00 2001 From: suchAdemon Date: Thu, 30 Aug 2018 14:04:02 +0200 Subject: [PATCH] git_update_all_branches.sh: improved functions --- git_update_all_branches.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/git_update_all_branches.sh b/git_update_all_branches.sh index e12acb1..02d19d9 100755 --- a/git_update_all_branches.sh +++ b/git_update_all_branches.sh @@ -35,7 +35,7 @@ then fi branchges=$(${BINgit} -C "${gitreppath}" br -a | grep -v remotes | grep -v "remotes/origin/HEAD" | wc -l) -activebranch="$(${BINgit} -C "${gitreppath}" branch | grep "\*" | awk '{print $2}')" +activebranch="$(${BINgit} -C "${gitreppath}" branch | grep -E "^\*" | awk '{print $2}')" HIDECURSOR echo -e "" @@ -47,13 +47,11 @@ echo -e " x x" echo -e " mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj" WRITE -for f in $(${BINgit} -C "${gitreppath}" br -a | grep -v remotes | awk '{print $1}') +for f in $(${BINgit} -C "${gitreppath}" br -a | grep -v remotes | sed -E 's/\* //g' | awk '{print $1}') do - #echo "Updateing[${branchcounter}/${branchges}]: ${f}" showBar ${branchcounter} ${branchges} ${f} "[$((${branchcounter} + 1))/${branchges}]" #Call bar drawing function "showBar" ${BINgit} -C "${gitreppath}" checkout "${f}" --quiet && ${BINgit} -C ${gitreppath} pull --rebase origin "${f}" --quiet >/dev/null 2>&1 branchcounter=$((${branchcounter} + 1)) - #showBar ${branchcounter} ${branchges} ${f} "[$((${branchcounter} + 1))/${branchges}]" #Call bar drawing function "showBar" done showBar ${branchcounter} ${branchges} ${f} "[${branchcounter}/${branchges}]" #Call bar drawing function "showBar" ${BINgit} -C "${gitreppath}" checkout "${activebranch}" --quiet