]> git.phdru.name Git - git-scripts.git/commitdiff
Feat(update-remotes): Reset `master` if fast-forward failed
authorOleg Broytman <phd@phdru.name>
Thu, 14 Dec 2023 20:04:17 +0000 (23:04 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 14 Dec 2023 20:04:17 +0000 (23:04 +0300)
update-remotes

index b164567bc369ac2ddc58d733bf22bb1a85b654dc..2eb9427fa531243a8a680c2b9fa5dc55a75ec870 100755 (executable)
@@ -16,7 +16,7 @@ elif [ -z "$current" ]; then
    exit 1
 fi
 
-git pull --ff-only current master &&
+{ git pull --ff-only current master || git reset --hard current/master } &&
 
 web="`git config --get --path remote.web.url`" &&
 if [ -n "$web" ]; then