Esempio n. 1
0
 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()
Esempio n. 2
0
 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()
Esempio n. 3
0
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')
Esempio n. 4
0
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')
Esempio n. 5
0
 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
Esempio n. 6
0
 def test_add(self):
     proj = self._proj('prj')
     assert proj.name == 'prj'
     assert gyt.is_git_dir(proj.git.path)
Esempio n. 7
0
 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)
Esempio n. 8
0
 def test_git_init_with_spaces(self):
     gyt.repo(self._gds, init=True)
     assert gyt.is_git_dir(self._gds)
Esempio n. 9
0
 def test_git_init_with_chinese(self):
     gyt.repo(self._gdc, init=True)
     assert gyt.is_git_dir(self._gdc)
Esempio n. 10
0
 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)
Esempio n. 11
0
 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)
Esempio n. 12
0
 def test_git_init_with_spaces(self):
     gyt.repo(self._gds, init=True)
     assert gyt.is_git_dir(self._gds)
Esempio n. 13
0
 def test_git_init_with_chinese(self):
     gyt.repo(self._gdc, init=True)
     assert gyt.is_git_dir(self._gdc)
Esempio n. 14
0
 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)
Esempio n. 15
0
 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
Esempio n. 16
0
 def test_add(self):
     proj = self._proj('prj')
     assert proj.name == 'prj'
     assert gyt.is_git_dir(proj.git.path)