8 * = either we have a temporary working directory created for each session/user etc..
10 * = what happens when multiple people try to access a working directory..
12 * = what happens if the same person is doing multiple things on the same workign directory..
18 require_once 'MTrack/SCM/WorkingCopy.php';
21 class MTrack_SCM_Git_WorkingCopy extends MTrack_SCM_WorkingCopy
24 public $push = false; ///
26 function __construct(MTrack_Repo $repo) {
28 $this->dir = $this->generateTempDir();;
32 MTrackSCM::run('git', 'string',
33 array('clone', $this->repo->repopath, $this->dir)
39 return stream_get_contents($this->git('push'));
44 function getFile($path)
46 return $this->repo->file($path);
49 function addFile($path)
51 $this->git('add', $path);
54 function delFile($path)
56 $this->git('rm', '-f', $path);
63 $d = strtotime($CS->when);
64 putenv("GIT_AUTHOR_DATE=$d -0000");
66 putenv("GIT_AUTHOR_DATE=");
68 $reason = trim($CS->reason);
69 if (!strlen($reason)) {
72 putenv("GIT_AUTHOR_NAME=$CS->who");
73 putenv("GIT_AUTHOR_EMAIL=$CS->who");
74 stream_get_contents($this->git('commit', '-a',
82 $args = func_get_args();
83 $a = array("--git-dir=$this->dir/.git", "--work-tree=$this->dir");
84 foreach ($args as $arg) {
88 return MTrackSCM::run('git', 'read', $a);