From b96424cf790ebe61b800dc66d4084c68e3a0f538 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Thu, 10 Sep 2026 16:27:29 -0400 Subject: [PATCH] bin(git-fetch-branch): Handle running within working directory --- bin/git-fetch-branch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/git-fetch-branch b/bin/git-fetch-branch index 0935a71..740a126 100755 --- a/bin/git-fetch-branch +++ b/bin/git-fetch-branch @@ -4,6 +4,8 @@ export USAGE=' or: ' +cd "$(git rev-parse --show-toplevel)" + # This is the recommended pattern from `man git-sh-setup`. # # shellcheck disable=SC1090 @@ -23,7 +25,6 @@ case "$#" in *) usage ;; esac - # I often change the fetch refmap to only watch my development branches and # permanent shared ones. Explicitly use a default-ish refmap to undo that and # make this create a named local branch.