]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
oeqa.utils.git: add git_dir property
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 2 Feb 2017 14:02:15 +0000 (16:02 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Feb 2017 04:06:27 +0000 (20:06 -0800)
[YOCTO #10582]

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/lib/oeqa/utils/git.py

index ae85d276637fd61920dc9ecc34f8939dc9a89d9d..5dd90e0d839c00aef5fb6c24dfce1f5c62013cc4 100644 (file)
@@ -18,6 +18,10 @@ class GitRepo(object):
     def __init__(self, path, is_topdir=False):
         self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'],
                                             path)
+        git_dir = self._run_git_cmd_at(['rev-parse', '--git-dir'], path)
+        git_dir = git_dir if os.path.isabs(git_dir) else os.path.join(path, git_dir)
+        self.git_dir = os.path.realpath(git_dir)
+
         realpath = os.path.realpath(path)
         if is_topdir and realpath != self.top_dir:
             raise GitError("{} is not a Git top directory".format(realpath))