From 183dead640ceb179923f2ad648dafc7789b9d609 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 18 Aug 2022 10:56:43 +0900 Subject: [PATCH] Fix CTRL-O when `git config branch."${branch}".remote` returning an URL --- fzf-git.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fzf-git.sh b/fzf-git.sh index 509ee1f..c5734a1 100644 --- a/fzf-git.sh +++ b/fzf-git.sh @@ -48,7 +48,7 @@ if [[ $# -gt 1 ]]; then esac remote=${remote:-$(git config branch."${branch}".remote || echo 'origin')} - remote_url=$(git remote get-url "$remote") + remote_url=$(git remote get-url "$remote" 2> /dev/null || echo "$remote") if [[ $remote_url =~ ^git@ ]]; then url=${remote_url%.git}