build: simplify git_init()

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-05-25 16:56:44 +01:00 committed by Leah Rowe
parent aaff90f5a5
commit 583135e548
1 changed files with 5 additions and 10 deletions

15
build
View File

@ -63,20 +63,15 @@ install_packages()
git_init()
{
[ -L ".git" ] && $err "Reference .git is a symlink"
[ -L ".git" ] && return 1
[ -e ".git" ] && return 0
eval "$(setvars "$(date -Rud @${versiondate})" cdate _nogit)"
git init 1>/dev/null 2>/dev/null || \
$err "${PWD}: cannot initialise Git repository"
git add -A . 1>/dev/null 2>/dev/null || \
$err "${PWD}: cannot add files to Git repository"
git init || return 1
git add -A . || return 1
git commit -m "${projectname} ${version}" --date "${cdate}" \
--author="xbmk <xbmk@example.com>" 1>/dev/null 2>/dev/null || \
$err "$PWD: can't commit ${projectname}/${version}, date $cdate"
git tag -a "${version}" -m "${projectname} ${version}" \
1>/dev/null 2>/dev/null || \
$err "${PWD}: cannot git-tag ${projectname}/${version}"
--author="xbmk <xbmk@example.com>" || return 1
git tag -a "${version}" -m "${projectname} ${version}" || return 1
}
mkrelease()