Esempio n. 1
0
 /**
  * GetHash
  *
  * Gets the hash for this ref (overrides base)
  *
  * @access public
  * @param boolean $abbreviate true to abbreviate hash
  * @return string object hash
  */
 public function GetHash($abbreviate = false)
 {
     if (empty($this->hash)) {
         $this->FindHash();
     }
     return parent::GetHash($abbreviate);
 }
Esempio n. 2
0
 /**
  * GetHash
  *
  * Gets the hash for this commit (overrides base)
  *
  * @access public
  * @param boolean $abbreviate true to abbreviate hash
  * @return string object hash
  */
 public function GetHash($abbreviate = false)
 {
     if ($this->GetProject()->GetCompat() && $abbreviate) {
         // abbreviated hash is loaded as part of commit data in compat mode
         if (!$this->dataRead) {
             $this->ReadData();
         }
     }
     return parent::GetHash($abbreviate);
 }
Esempio n. 3
0
 /**
  * Gets the hash for this commit (overrides base)
  *
  * @param boolean $abbreviate true to abbreviate hash
  * @return string object hash
  */
 public function GetHash($abbreviate = false)
 {
     if ($abbreviate && $this->strategy->LoadsAbbreviatedHash()) {
         if (!$this->dataRead) {
             $this->ReadData();
         }
     }
     return parent::GetHash($abbreviate);
 }
Esempio n. 4
0
 /**
  * Gets a hash for a string or hash-identified object
  *
  * @param string|GitPHP_GitObject $value string or hashed object
  * @param boolean $abbreviate true to abbreviate hash
  * @return string hash
  */
 private static function GetHash($value, $abbreviate = false)
 {
     if ($value instanceof GitPHP_GitObject) {
         return $value->GetHash($abbreviate);
     } else {
         if (is_string($value)) {
             return $value;
         }
     }
     return null;
 }