<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>11515</bug_id>
          
          <creation_ts>2017-05-17 03:54:59 +0000</creation_ts>
          <short_desc>test &apos;commit&apos; first in get_vcs_reference</short_desc>
          <delta_ts>2017-08-07 19:27:32 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>Toaster</product>
          <component>toaster</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.4 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Reyna">david.reyna</reporter>
          <assigned_to name="David Reyna">david.reyna</assigned_to>
          <cc>jessica.zhang</cc>
    
    <cc>stanciux.mihail</cc>
          
          <qa_contact name="Libertad">libertad.gonzalez.de.la.cruz</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73289</commentid>
    <comment_count>0</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-05-17 03:54:59 +0000</bug_when>
    <thetext>The &apos;commit&apos; value should be tested and used first when resolving the ref for a layer, since that is an explicit override in each layer index &apos;layeritem&apos; record.

If should take precedence over more-global &apos;branch&apos; and &apos;release&apos; values, instead of being last.

Proposed patch is:

     def get_vcs_reference(self):
+        if self.commit is not None and len(self.commit) &gt; 0:
+            return self.commit
         if self.branch is not None and len(self.branch) &gt; 0:
             return self.branch
         if self.release is not None:
             return self.release.name
-        if self.commit is not None and len(self.commit) &gt; 0:
-            return self.commit
         return &apos;N/A&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>75698</commentid>
    <comment_count>1</comment_count>
    <who name="David Reyna">david.reyna</who>
    <bug_when>2017-08-07 19:27:32 +0000</bug_when>
    <thetext>commit b4b2e6d4dfa4bac7aec100bae4bca36e371e4ed9</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>