lib/libnetwork.lib.in: make sure requested commit to checkout exists or fail

This commit is contained in:
Silvan Calarco 2024-02-08 17:23:01 +01:00
parent 52f6c8266f
commit 7233b80200

View File

@ -980,6 +980,9 @@ function git.create_tarball() {
if [ "${git_branch/@*}" != "${git_branch}" ]; then
git_commit="${git_branch/*@}"
git_branch="${git_branch/@*}"
if [ ! "${git_commit}" ]; then
notify.error "$FUNCNAME: cannot checkout empty commit"
fi
fi
notify.debug "$FUNCNAME: git_branch = \"$git_branch\""
if [ "${git_commit}" ]; then
@ -1053,7 +1056,11 @@ not the expected package version"" (${NOTE}${today}git${NORM})..."
if [ "${git_commit}" ]; then
cd ${pck_tarball}
git checkout ${git_commit}
git checkout ${git_commit} || {
popd &>/dev/null
rm -fr $tmpgitdir
notify.error $"cannot checkout the specified tag";
}
cd ..
fi