diff --git a/lib/libnetwork.lib.in b/lib/libnetwork.lib.in index afcc9b5..673332a 100644 --- a/lib/libnetwork.lib.in +++ b/lib/libnetwork.lib.in @@ -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