# `gbp.git.fastimport.FastImport(object)` class documentation

Part of `gbp.git.fastimport` (View In Hierarchy)

Add data to a git repository using git fast-import

Method | __init__ |
Method | add_file | Add a file
Method | add_symlink | Add a symlink
Method | start_commit | Start a fast import commit
Method | deleteall | Issue deleteall to fastimport so we start from a empty tree
Method | close | Close fast-import issuing all pending actions
Method | __del__ | Undocumented
Method | _do_data | Undocumented
Method | _do_file | Undocumented

def __init__(self, repo):

Parameters | repo | the git repository `FastImport` acts on (type: `GitRepository`)

def _do_data(self, fd, size):
Undocumented
def _do_file(self, filename, mode, fd, size):
Undocumented
def add_file(self, filename, fd, size, mode=m_regular):

Add a file

Parameters | filename | the name of the file to add (type: `str`)
| fd | stream to read data from (type: `File` like object)
| size | size of the file to add (type: `int`)
| mode | file mode, default is `FastImport.m_regular`. (type: `int`)

def add_symlink(self, linkname, linktarget):

Add a symlink

Parameters | linkname | the symbolic link's name
| linkname | `str`
| linktarget | the target the symlink points to (type: `str`)

def start_commit(self, branch, committer, msg):

Start a fast import commit

Parameters | branch | branch to commit on (type: `str`)
| committer | the committer information (type: `GitModifier`)
| msg | the commit message (type: `str`)

def deleteall(self):

Issue deleteall to fastimport so we start from a empty tree

def close(self):

Close fast-import issuing all pending actions

def __del__(self):
Undocumented