diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-02-02 16:02:15 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-15 20:06:41 -0800 |
commit | 5c907bde11be1af6e3d57b0c68cd040e04b4000c (patch) | |
tree | 4f61e64441a5ce2fedf51e7ee5f5c1c472a814d2 /meta/lib | |
parent | fcd28fd50f6f3768c41f1db184f55cd439699bd7 (diff) | |
download | poky-5c907bde11be1af6e3d57b0c68cd040e04b4000c.tar.gz |
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>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | 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 ae85d27663..5dd90e0d83 100644 --- a/meta/lib/oeqa/utils/git.py +++ b/meta/lib/oeqa/utils/git.py | |||
@@ -18,6 +18,10 @@ class GitRepo(object): | |||
18 | def __init__(self, path, is_topdir=False): | 18 | def __init__(self, path, is_topdir=False): |
19 | self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'], | 19 | self.top_dir = self._run_git_cmd_at(['rev-parse', '--show-toplevel'], |
20 | path) | 20 | path) |
21 | git_dir = self._run_git_cmd_at(['rev-parse', '--git-dir'], path) | ||
22 | git_dir = git_dir if os.path.isabs(git_dir) else os.path.join(path, git_dir) | ||
23 | self.git_dir = os.path.realpath(git_dir) | ||
24 | |||
21 | realpath = os.path.realpath(path) | 25 | realpath = os.path.realpath(path) |
22 | if is_topdir and realpath != self.top_dir: | 26 | if is_topdir and realpath != self.top_dir: |
23 | raise GitError("{} is not a Git top directory".format(realpath)) | 27 | raise GitError("{} is not a Git top directory".format(realpath)) |