local/bin/homesync: Use push remote instead of upstream

master
Pierre Neidhardt 2018-06-21 19:54:39 +02:00
parent 0e5614cf4f
commit 0f192fe0dc
1 changed files with 4 additions and 4 deletions

View File

@ -58,12 +58,12 @@ project_status() {
for i in ~/dotfiles ~/.password-store ~/personal ~/projects/* ~/.local/share/emacs/site-lisp/* "$@"; do
[ ! -d "$i/.git" ] && continue
CHANGED=true
upstream=$(git -C "$i" rev-parse --abbrev-ref --symbolic-full-name @{u} 2>&1)
push=$(git -C "$i" rev-parse --abbrev-ref --symbolic-full-name @{push} 2>&1)
if [ $? -eq 0 ]; then
unmerged=$(git -C "$i" log --oneline "$upstream"..)
project_status "$i" "Unmerged commits" "$unmerged"
unmerged=$(git -C "$i" log --oneline "$push"..)
project_status "$i" "Unpushed commits" "$unmerged"
else
project_status "$i" "Unmerged commits" "$upstream"
project_status "$i" "Unpushed commits" "No 'push' remote"
fi
project_status "$i" "Unstaged files" "$(git -C "$i" diff --name-only)"
project_status "$i" "Staged files" "$(git -C "$i" diff --name-only --cached)"