From: Mike Frysinger Date: Thu, 27 Dec 2018 08:19:28 +0000 (-0500) Subject: git-rb-all: handle missing working dirs X-Git-Url: https://git.wh0rd.org/?p=home.git;a=commitdiff_plain;h=fa1a0920fe3009bd92dc6872e265588b998b4d19 git-rb-all: handle missing working dirs --- diff --git a/.bin/git-rb-all b/.bin/git-rb-all index 0323d73..ef3f54c 100755 --- a/.bin/git-rb-all +++ b/.bin/git-rb-all @@ -28,6 +28,9 @@ main() { usage fi + # Switch to the top dir in case the working dir doesn't exist in every branch. + cd "$(git rev-parse --show-toplevel)" || return + local orig b branches orig=$(git rev-parse --abbrev-ref HEAD) || return