From 8d9d0bfd421d3a58cf82099b6e2f5021414aa851 Mon Sep 17 00:00:00 2001 From: William Hilton Date: Fri, 5 Apr 2019 15:24:01 -0400 Subject: [PATCH] fix: 'g branches' on OSX --- bin/g | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/g b/bin/g index 7e46e46..70666d2 100755 --- a/bin/g +++ b/bin/g @@ -268,9 +268,9 @@ git branch --merged | sed 's/^..//' > "$TEMP/merged.branches" # Pretty-print local branches git for-each-ref --sort=-committerdate refs/heads \ --format='%(HEAD) %(color:green)%(committerdate:relative)%(color:reset)|%(color:red)%(objectname:short)%(color:reset)|%(color:yellow)%(refname:short)%(color:reset) -> %(upstream:short)' > "$TEMP/local.branches" -sed -i 's/ -> $/ -> \?/g' "$TEMP/local.branches" +sed -i'' -e 's/ -> $/ -> \?/g' "$TEMP/local.branches" while read -r branch; do - sed -i "s~${branch}\b.*~\0|(merged)~" "$TEMP/local.branches" + sed -i'' -e 's~'${branch}'[[:>:]].*~&|(merged)~' "$TEMP/local.branches" done < "$TEMP/merged.branches" # Pretty-print remote branches git for-each-ref --sort=-committerdate refs/remotes \