API

Implementation of fastgit

Imports

import tempfile
from fastcore.test import test_eq

source

callgit


def callgit(
    path, args:VAR_POSITIONAL, split:NoneType=None, uname:NoneType=None
):

source

get_top


def 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


def 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


def last_commit(
    
):