From df9047f868b874fb88f56505839b934eccabb3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 12 Jul 2021 22:08:39 +0200 Subject: git-outofdate: Handle repositories without remote --- git/git-outofdate | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'git/git-outofdate') diff --git a/git/git-outofdate b/git/git-outofdate index b430e2a..83dc7d5 100755 --- a/git/git-outofdate +++ b/git/git-outofdate @@ -5,10 +5,14 @@ [ -z "$1" ] && { echo usage: $0 dir 1>&2; exit 1; } find "$1" -type d -name .git | while read -r dir; do - printf %s "$(readlink -f "$dir"/..)" ( cd "$dir"/.. - git status -uno | sed -n '/^Your branch/{s///;p}' + git status -uno | sed -n '/^Your branch/{s///;p}' | + while read -r s; do + cd - + printf '%s %s\n' "$(readlink -f "$dir"/..)" "$s" + break + done ) done | grep -v 'up to date' -- cgit v1.2.3