From e621dbbff631d889858dbed8fef95c515055812c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 27 Apr 2016 09:36:35 +0200 Subject: versteht jetzt auch mehrere Remotes --- bash-git-prompt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bash-git-prompt b/bash-git-prompt index 85d1bd0..b61d606 100755 --- a/bash-git-prompt +++ b/bash-git-prompt @@ -26,14 +26,18 @@ then )" echo "$status" | grep -q "^.\S" && wtClean=false || wtClean=true echo "$status" | grep -q "^\S" && idxClean=false || idxClean=true - remBranch="$( - echo "${branches}" | \ - grep '^\s*remotes/[^/]\+/'"${branch}" | \ - sed 's|^\s*\(remotes/[^/]\+/'"${branch}"'\)/.*$|\1|' - )" - [ -n "${remBranch}" ] && \ - [ "$(git describe --always --abbrev=0 "HEAD")" == "$(git describe --always --abbrev=0 "${remBranch}")" ] && \ - remClean=true || remClean=false + + remClean=true + for remBranch in \ + $( + echo "${branches}" | \ + grep '^\s*remotes/[^/]\+/'"${branch}" | \ + sed 's|^\s*\(remotes/[^/]\+/'"${branch}"'\)/.*$|\1|' + ) + do + [ "$(git describe --always --abbrev=0 "HEAD")" == "$(git describe --always --abbrev=0 "${remBranch}")" ] \ + || remClean=false + done if $mitFarbe then if ! $wtClean -- cgit v1.2.3-54-g00ecf