Restructured one more time to be as SCM independent as possible.

The work is delegated as much as possible to the IDF_Scm_* classes.
This commit is contained in:
Loic d'Anterroches
2008-09-02 15:51:57 +02:00
parent 57a5b4738a
commit 2d271f6b69
7 changed files with 125 additions and 62 deletions

View File

@@ -35,6 +35,35 @@ class IDF_Scm_Git
$this->repo = $repo;
}
/**
* Returns the URL of the git daemon.
*
* @param IDF_Project
* @return string URL
*/
public static function getRemoteAccessUrl($project)
{
$url = Pluf::f('git_remote_url');
if (Pluf::f('git_repositories_unique', true)) {
return $url;
}
return $url.'/'.$project->shortname.'.git';
}
/**
* Returns this object correctly initialized for the project.
*
* @param IDF_Project
* @return IDF_Scm_Git
*/
public static function factory($project)
{
$rep = Pluf::f('git_repositories');
if (false == Pluf::f('git_repositories_unique', false)) {
$rep = $rep.'/'.$project->shortname.'.git';
}
return new IDF_Scm_Git($rep);
}
/**
* Test a given object hash.