[oe-commits] Chris Larson : gitver: fix non-symbolic HEAD ref
git version control
git at git.openembedded.org
Wed Oct 27 22:10:46 UTC 2010
Module: openembedded.git
Branch: master
Commit: ddffbe483ece35a02449d56b1a1ea45af08a0f4d
URL: http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=ddffbe483ece35a02449d56b1a1ea45af08a0f4d
Author: Chris Larson <chris_larson at mentor.com>
Date: Wed Oct 27 14:54:20 2010 -0700
gitver: fix non-symbolic HEAD ref
Signed-off-by: Chris Larson <chris_larson at mentor.com>
---
classes/gitver.bbclass | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/classes/gitver.bbclass b/classes/gitver.bbclass
index de182a0..28256c6 100644
--- a/classes/gitver.bbclass
+++ b/classes/gitver.bbclass
@@ -32,17 +32,16 @@ def get_git_pv(path, d, tagadjust=None):
# if the active branch is switched, or if the branch changes.
mark_dependency(d, os.path.join(gitdir, "HEAD"))
- ref = git(["symbolic-ref", "HEAD"])
- if ref:
- reffile = os.path.join(gitdir, ref)
- if os.path.exists(reffile):
- mark_dependency(d, reffile)
- else:
- mark_dependency(d, os.path.join(gitdir, "index"))
+ # Force a reparse if anything in the index changes.
+ mark_dependency(d, os.path.join(gitdir, "index"))
+
+ try:
+ ref = oe_run(d, ["git", "symbolic-ref", "-q", "HEAD"], cwd=gitdir).rstrip()
+ except oe.process.CmdError:
+ pass
else:
- # The ref might be hidden in packed-refs. Force a reparse if anything
- # in the working copy changes.
- mark_dependency(d, os.path.join(gitdir, "index"))
+ if ref:
+ mark_dependency(d, os.path.join(gitdir, ref))
# Catch new tags.
tagdir = os.path.join(gitdir, "refs", "tags")
More information about the Openembedded-commits
mailing list