]> git.wh0rd.org - home.git/blobdiff - .bin/git-rb-all
git-rb-all: handle missing working dirs
[home.git] / .bin / git-rb-all
index 0323d73ba451152045011412be816ad25a60fd36..ef3f54c773596eb17cf39607052b1392f2f947e5 100755 (executable)
@@ -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