summaryrefslogtreecommitdiff
path: root/git.py
diff options
context:
space:
mode:
authorVanya Sergeev <vsergeev@gmail.com>2013-10-13 15:30:25 +0200
committerAlberto Bertogli <albertito@blitiri.com.ar>2013-11-02 20:07:59 +0100
commit21522f8a3a4a010ad717f5bdcbbc6584d9ba7527 (patch)
treefd2327266ab4fb524bb03b5ea933a621367c7f3e /git.py
parentf62ca211ebf8badd17fef5d15d61eb8ff00875c1 (diff)
downloadgit-arr-fork-21522f8a3a4a010ad717f5bdcbbc6584d9ba7527.zip
Add embed data URI image blob support
Diffstat (limited to 'git.py')
-rw-r--r--git.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/git.py b/git.py
index f0e73ba..deddeba 100644
--- a/git.py
+++ b/git.py
@@ -325,7 +325,7 @@ class Repo:
ref = self.branch
return Tree(self, ref)
- def blob(self, path, ref = None):
+ def blob(self, path, ref = None, raw = False):
"""Returns the contents of the given path."""
if not ref:
ref = self.branch
@@ -341,6 +341,10 @@ class Repo:
if not head or head.strip().endswith('missing'):
return None
+ # Raw option in case we need a binary blob and not a utf-8 encoded one.
+ if raw:
+ return out.fd.read()
+
return out.read()