From 2f233b362b00042aeedefec327ded51ce14a580b Mon Sep 17 00:00:00 2001 From: Oren Mazor Date: Thu, 30 Nov 2017 09:11:23 -0500 Subject: [PATCH] if we fail to find the ancestor, just try to compare to master --- pre_commit/resources/pre-push-tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pre_commit/resources/pre-push-tmpl b/pre_commit/resources/pre-push-tmpl index f866eeff..3232f863 100644 --- a/pre_commit/resources/pre-push-tmpl +++ b/pre_commit/resources/pre-push-tmpl @@ -9,11 +9,12 @@ do # Check that the ancestor has at least one parent git rev-list --max-parents=0 "$local_sha" | grep "$first_ancestor" > /dev/null if [ $? -ne 0 ]; then - args="--all-files" + source=$(git rev-parse master) else source=$(git rev-parse "$first_ancestor"^) - args="--origin $local_sha --source $source" fi + + args="--origin $local_sha --source $source" fi else args="--origin $local_sha --source $remote_sha"