]> git.wh0rd.org - home.git/commitdiff
git-rb-all: handle missing working dirs
authorMike Frysinger <vapier@gentoo.org>
Thu, 27 Dec 2018 08:19:28 +0000 (03:19 -0500)
committerMike Frysinger <vapier@gentoo.org>
Thu, 27 Dec 2018 08:19:28 +0000 (03:19 -0500)
.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