From fa1a0920fe3009bd92dc6872e265588b998b4d19 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 27 Dec 2018 03:19:28 -0500 Subject: [PATCH] git-rb-all: handle missing working dirs --- .bin/git-rb-all | 3 +++ 1 file changed, 3 insertions(+) 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 -- 2.39.5