API

Implementation of fastgit

Imports

import tempfile
from fastcore.test import test_eq

source

callgit

 callgit (path, *args, split=None, uname=None)

source

get_top

 get_top (folder)
with tempfile.TemporaryDirectory() as td:
    test_eq(get_top(td), None)
    msg = callgit(td, 'init')
    assert get_top(td) in msg

Git represents a python wrapper for the git command. It will execute every command as if git were being run with the working directory being the directory d passed in at init time.

As a result, callers should take care not to checkout a branch which does not have the directory used to initialize Git.


source

Git

 Git (d)

Initialize self. See help(type(self)) for accurate signature.

with tempfile.TemporaryDirectory() as td:
    g = Git(td)
    assert not g.exists
    msg = g.init()
    assert g.top() in msg

source

Git.last_commit

 Git.last_commit ()