diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-10 12:49:45 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-08-10 12:49:45 +0200 |
commit | 4954036205385c3e819dc1b64fc0e7c28fe487e9 (patch) | |
tree | 32e6e54d990e217a56c3de7009646d599efb418f /fit.py | |
parent | 266d595e0dadbf187ad67e17350f5c79044cad61 (diff) | |
download | klausuren-4954036205385c3e819dc1b64fc0e7c28fe487e9.tar.gz klausuren-4954036205385c3e819dc1b64fc0e7c28fe487e9.tar.bz2 klausuren-4954036205385c3e819dc1b64fc0e7c28fe487e9.zip |
added some doc strings
Diffstat (limited to 'fit.py')
-rw-r--r-- | fit.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -10,6 +10,7 @@ class Fit: self.repo = Repository(path) def _insert_node(self, node_oid, path, root_oid): + """ Inserts a new Node in a Git Tree graph """ if root_oid: root = self.repo.TreeBuilder(root_oid) current_node = self.repo[root_oid] @@ -36,7 +37,7 @@ class Fit: # directories to create new_path = dir_path[len(existing_builders)-1:] - # create blob + # inserts blob object if len(new_path) > 0: builder = self.repo.TreeBuilder() else: @@ -74,6 +75,7 @@ class Fit: def add_file(self, data, path): + """ Inserts the given file in the git tree and commits the changes """ try: commit = self._get_last_commit() parents = [commit.oid] @@ -100,7 +102,13 @@ class Fit: return b2a_hex(blob_oid).decode('ascii') + def get_file(self, oid): + """ Returns the actual data of a git object """ + return self.repo[oid].data + + def _list(self, path=None): + """ Lists all entries for a given path """ try: commit = self._get_last_commit() tree = commit.tree |