Fixing some issues with project default branches, adding tests for that too

This commit is contained in:
Dan Cryer 2014-07-14 14:59:04 +01:00
commit cb53ec9c6d
6 changed files with 111 additions and 9 deletions

View file

@ -58,4 +58,18 @@ class Project extends ProjectBase
return $rtn;
}
/**
* Get the value of Branch / branch.
*
* @return string
*/
public function getBranch()
{
if (empty($this->data['branch'])) {
return $this->getType() === 'hg' ? 'default' : 'master';
} else {
return $this->data['branch'];
}
}
}