diff options
author | Vanya Sergeev <vsergeev@gmail.com> | 2013-10-13 15:30:25 +0200 |
---|---|---|
committer | Alberto Bertogli <albertito@blitiri.com.ar> | 2013-11-02 20:07:59 +0100 |
commit | 21522f8a3a4a010ad717f5bdcbbc6584d9ba7527 (patch) | |
tree | fd2327266ab4fb524bb03b5ea933a621367c7f3e /git.py | |
parent | f62ca211ebf8badd17fef5d15d61eb8ff00875c1 (diff) | |
download | git-arr-fork-21522f8a3a4a010ad717f5bdcbbc6584d9ba7527.zip |
Add embed data URI image blob support
Diffstat (limited to 'git.py')
-rw-r--r-- | git.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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() |