def test_not_bare_clone_to_not_bare(self): rep = gyt.repo(self._gd, init=True, bare=False) clone = rep.clone(self._wt2, bare=False) assert not gyt.is_git_dir(self._wt2) clone = gyt.repo(self._wt2, bare=False) assert clone.config('remote.origin.url') == rep.git_dir assert not clone.is_bare()
def project_fsck_and_gc(): weekday = datetime.today().weekday() if weekday != 6: return result = get_projects() for proj in result: if is_git_dir(proj.git_dir) and not proj.git.is_empty(): proj.git.call('fsck --full') proj.git.call('gc') proj.git.call('repack -adf')
def test_fork(self): proj = self._proj('test_proj') fork = proj.fork('test_proj_fork', 'user2') assert gyt.is_git_dir(fork.git.path) assert fork.fork_from == proj.id assert fork.id != proj.id
def test_add(self): proj = self._proj('prj') assert proj.name == 'prj' assert gyt.is_git_dir(proj.git.path)
def test_fake_git_dir(self): os.mkdir(opj(self._gd, 'refs')) assert os.path.exists(opj(self._gd, 'refs')) assert not gyt.is_git_dir(self._gd)
def test_git_init_with_spaces(self): gyt.repo(self._gds, init=True) assert gyt.is_git_dir(self._gds)
def test_git_init_with_chinese(self): gyt.repo(self._gdc, init=True) assert gyt.is_git_dir(self._gdc)
def test_is_git_dir(self): assert not gyt.is_git_dir(self._gd) gyt.repo(self._gd, init=True) assert gyt.is_git_dir(self._gd)