[oe-commits] Cliff Brake : gitver.bbclass: fix issue with detached heads

git version control git at git.openembedded.org
Tue Jun 15 20:24:34 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 1a8df1e6ddb95eb98f2d0b17e2855790ab710ea3
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=1a8df1e6ddb95eb98f2d0b17e2855790ab710ea3

Author: Cliff Brake <cbrake at bec-systems.com>
Date:   Tue Jun 15 16:23:28 2010 -0400

gitver.bbclass: fix issue with detached heads

---

 classes/gitver.bbclass |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/classes/gitver.bbclass b/classes/gitver.bbclass
index 5b4ba8d..445067e 100644
--- a/classes/gitver.bbclass
+++ b/classes/gitver.bbclass
@@ -38,9 +38,12 @@ def get_git_pv(path, d, tagadjust=None):
     mark_dependency(d, os.path.join(gitdir, "HEAD"))
 
     ref = popen(["git", "symbolic-ref", "HEAD"])
-    reffile = os.path.join(gitdir, ref)
-    if ref and os.path.exists(reffile):
-        mark_dependency(d, reffile)
+    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"))
     else:
         # The ref might be hidden in packed-refs. Force a reparse if anything
         # in the working copy changes.





More information about the Openembedded-commits mailing list