From b28331b896b9c129d367fd06b6b7447ed7255f20 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 2 Aug 2016 15:41:21 -0400 Subject: [PATCH] Augments .git_functions for null-checking --- .git_functions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.git_functions.sh b/.git_functions.sh index 142be519e..1ed0fc0d8 100644 --- a/.git_functions.sh +++ b/.git_functions.sh @@ -51,7 +51,9 @@ function wgcheckout { # wgcheckout combined with a fuzzy search function wgfcheckout { - wgcheckout $(git branch | fzf) + branchname=$(git branch | fzf) + + [ ! -z "$branchname" ] && wgcheckout "$branchname" || return }