[gnome-continuous-yocto/gnomeostree-3.28-rocko: 4584/8267] oeqa.utils.git: add git_dir property



commit 5c907bde11be1af6e3d57b0c68cd040e04b4000c
Author: Markus Lehtonen <markus lehtonen linux intel com>
Date:   Thu Feb 2 16:02:15 2017 +0200

    oeqa.utils.git: add git_dir property
    
    [YOCTO #10582]
    
    (From OE-Core rev: 5fce33644a58b55d0af6c1775e8f65b426eb4dcb)
    
    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>

 meta/lib/oeqa/utils/git.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/meta/lib/oeqa/utils/git.py b/meta/lib/oeqa/utils/git.py
index ae85d27..5dd90e0 100644
--- a/meta/lib/oeqa/utils/git.py
+++ b/meta/lib/oeqa/utils/git.py
@@ -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))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]