mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
if we fail to find the ancestor, just try to compare to master
This commit is contained in:
parent
41d998f1c4
commit
2f233b362b
1 changed files with 3 additions and 2 deletions
|
|
@ -9,11 +9,12 @@ do
|
||||||
# Check that the ancestor has at least one parent
|
# Check that the ancestor has at least one parent
|
||||||
git rev-list --max-parents=0 "$local_sha" | grep "$first_ancestor" > /dev/null
|
git rev-list --max-parents=0 "$local_sha" | grep "$first_ancestor" > /dev/null
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
args="--all-files"
|
source=$(git rev-parse master)
|
||||||
else
|
else
|
||||||
source=$(git rev-parse "$first_ancestor"^)
|
source=$(git rev-parse "$first_ancestor"^)
|
||||||
args="--origin $local_sha --source $source"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
args="--origin $local_sha --source $source"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
args="--origin $local_sha --source $remote_sha"
|
args="--origin $local_sha --source $remote_sha"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue