diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-20 12:46:19 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-06-20 12:46:19 +0200 |
commit | f3ca3f8988c2af29c8d13b5336d1bfefb3e36c81 (patch) | |
tree | 747d3257c7e8f3b32c5a0dde7cbf023590a58bca /bin/common | |
parent | 70f32ce6e61898fc8a63112f7b38eff7a2d703fb (diff) |
fix error on multiple branches
Diffstat (limited to 'bin/common')
-rwxr-xr-x | bin/common/gt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/common/gt b/bin/common/gt index 53d2cab..c679b23 100755 --- a/bin/common/gt +++ b/bin/common/gt @@ -5,7 +5,6 @@ # dependencies: # - git # - $EDITOR: -e -# - herbe (optional): -s repos=$HOME/sync/share/git-track.txt # prevent file not found errors @@ -47,7 +46,8 @@ status() { >&2 printf '\r\033[0K' status="$(git status --porcelain 2> /dev/null | awk '{print $1}' | uniq | tr -d '\n')" - remote="$(git branch -v 2>/dev/null | sed 's/ahead/↑/;s/behind/↓/;s/[^↓↑]*//g')" + remote="$(git branch -v 2>/dev/null | + sed '/^*/!d;s/ahead/↑/;s/behind/↓/;s/[^↓↑]*//g')" printf '%s %s %s\n' "$repo_pretty" "$status" "$remote" done < "$repos" @@ -116,6 +116,6 @@ fi if [ "$f_status" ] then status - which herbe > /dev/null 2>&1 && - eval "herbe $(status | sed 's/"/\"/g;s/.*/"&"/' | tr '\n' ' ')" & fi + +# eval "herbe $(status | sed 's/"/\"/g;s/.*/"&"/' | tr '\n' ' ')" |