local status i branch
local ret=0
local sav_pwd=${PWD:-$(pwd)}
+
for i in ${@:-$(nb_repos)}; do
cd "$i" || continue
+
local branch_orig=$(git branch | awk '/^\*/{print $2}')
[ -z "$branch_orig" ] && continue
+ local u=$( ls -1dl "$i" | awk '{print $3}' )
+ if [ "$u" != "$USER" ]; then
+ #echo "$i [WRONG OWNER]"
+ printf "%s %s\n" "$i [$branch_orig]" "WRONG OWNER"
+ continue
+ fi
+
for branch in $(git branch | sed -E 's/^[\* ]+//'); do
- git checkout --quiet "$branch" || continue
+
+ git checkout --quiet "$branch" 2>/dev/null || continue
status=$(git status --short | grep -v '^#'|sed 's/^/ /') || continue
[ -n "$status" ] && status=$'\n'"$status" && ret=1
printf "%s %s\n" "$i [$branch]" "$status"
+
done
git checkout --quiet "$branch_orig"
+
done
+
cd "$sav_pwd"
return $ret
}