Signed-off-by: Chris Larson <clarson@mvista.com>
def base_get_metadata_git_branch(path, d):
import os
- branch = os.popen('cd %s; git symbolic-ref HEAD' % path).read().rstrip()
+ branch = os.popen('cd %s; git symbolic-ref HEAD 2>/dev/null' % path).read().rstrip()
if len(branch) != 0:
return branch.replace("refs/heads/", "")
def base_get_metadata_git_revision(path, d):
import os
- rev = os.popen("cd %s; git show-ref HEAD" % path).read().split(" ")[0].rstrip()
+ rev = os.popen("cd %s; git show-ref HEAD 2>/dev/null" % path).read().split(" ")[0].rstrip()
if len(rev) != 0:
return rev
return "<unknown>"