mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
build-system: avoid checkout when unneeded
Checkout only if current checked out version differs from expected. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
This commit is contained in:
parent
550b6f179f
commit
7d92f5f811
1 changed files with 9 additions and 4 deletions
|
@ -38,10 +38,15 @@ git_checkout_library() {
|
||||||
fi
|
fi
|
||||||
pushd "$name"
|
pushd "$name"
|
||||||
|
|
||||||
git fetch origin
|
local current_sha=$(git rev-parse HEAD)
|
||||||
if ! git checkout "$version" ; then
|
local target_sha=$(git rev-parse "$version")
|
||||||
echo "Can't find the right tag in $name - giving up"
|
|
||||||
return -1
|
if [ ! "$current_sha" = "$target_sha" ] ; then
|
||||||
|
git fetch origin
|
||||||
|
if ! git checkout "$version" ; then
|
||||||
|
echo "Can't find the right tag in $name - giving up"
|
||||||
|
return -1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
popd
|
popd
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue