From 4a529f742da6241572291f33c43827d16b0ed479 Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Fri, 8 Mar 2024 19:12:03 -0500 Subject: [PATCH] Perform sync even pushdot has no changes to commit --- fake_home/.zshrc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/fake_home/.zshrc b/fake_home/.zshrc index 500fa95..88236b6 100644 --- a/fake_home/.zshrc +++ b/fake_home/.zshrc @@ -170,19 +170,21 @@ function load-extensions { function pushdot { cd "$DOT_DIR" || return 1 local res - if [ $# -eq 0 ]; then - git commit -a - res="$?" - else - git commit -a -m "$@" - res="$?" - fi - if [[ "$res" == "0" ]]; then - git push -u origin main - push-extensions - sync-history - push-dconf + if ! git diff --quiet; then + if [ $# -eq 0 ]; then + git commit -a + res="$?" + else + git commit -a -m "$@" + res="$?" + fi + if [[ "$res" == "0" ]]; then + git push -u origin main + fi fi + push-extensions + sync-history + push-dconf cd - return $res }