diff options
author | John Ankarström <john@ankarstrom.se> | 2021-07-12 22:08:39 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-07-12 22:08:58 +0200 |
commit | df9047f868b874fb88f56505839b934eccabb3e6 (patch) | |
tree | 6cadb73ae121e08728a0ffe60ca74f9e0d4c45d8 | |
parent | ac9ae08170243f1cbe31c8664baef02d787f2aa5 (diff) | |
download | xutil-df9047f868b874fb88f56505839b934eccabb3e6.tar.gz |
git-outofdate: Handle repositories without remote
-rwxr-xr-x | git/git-outofdate | 8 |
1 files changed, 6 insertions, 2 deletions
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' |