Last active
December 23, 2019 14:58
-
-
Save refactorsaurusrex/2259e14c981e2b353df1f8b6066769dc to your computer and use it in GitHub Desktop.
Revisions
-
refactorsaurusrex revised this gist
Dec 23, 2019 . No changes.There are no files selected for viewing
-
refactorsaurusrex revised this gist
Oct 23, 2017 . No changes.There are no files selected for viewing
-
refactorsaurusrex created this gist
Oct 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/bin/sh if [ "$2" = "merge" ]; then githead=$(env | grep GITHEAD) source="${githead##*=}" target=$(git symbolic-ref HEAD) behind=$(git rev-list --left-only --count $target...$source) if [ $behind -gt 0 ]; then echo "Aborting: The source branch is $behind commits behind the target branch." exit 1 fi fi #ref https://superuser.com/a/926038/51794