buildhistory: fix the check for existence of a git repo

Previously, in order to determine the existence of an already
initialized Git repository we checked if a directory named '.git' was
present in the buildhistory dir. However, e.g. in the case of git
submodules '.git' may also be a regular file referencing some other
location which was causing unwanted behavior. This patch changes
buildhistory.bbclass to check for any file named '.git' which fixes
these problems.

[YOCTO #8911]

(From OE-Core rev: a5e931e0b1d941cc938fe2f49625c54b07fab0ce)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen 2016-01-27 14:50:53 +02:00 committed by Richard Purdie
parent d74325e22e
commit 70814586bb
1 changed files with 1 additions and 1 deletions

View File

@ -684,7 +684,7 @@ END
( cd ${BUILDHISTORY_DIR}/
# Initialise the repo if necessary
if [ ! -d .git ] ; then
if [ ! -e .git ] ; then
git init -q
else
git tag -f build-minus-3 build-minus-2 > /dev/null 2>&1 || true