code: def return_document(self, doc_id, branch='master', commit_sha=None, return_WIP_map=False):
          
          # _LOG.debug('return_document({s}, {b}, {c}...)'.format(s=doc_id, b=branch, c=commit_sha))
          if commit_sha is None:
              self.checkout(branch)
              head_sha = get_HEAD_SHA1(self.git_dir)
          else:
              self.checkout(commit_sha)
              head_sha = commit_sha
          doc_filepath = self.path_for_doc(doc_id)
          try:
              with codecs.open(doc_filepath, mode='r', encoding='utf-8') as f:
                  content = f.read()
          except:
              content = None
          if return_WIP_map:
              d = self.find_WIP_branches(doc_id)
              return content, head_sha, d
          return content, head_sha
docs: Return the
              blob[0] contents of the given doc_id,
              blob[1] the SHA1 of the HEAD of branch (or `commit_sha`)
              blob[2] dictionary of WIPs for this doc.
          If the doc_id does not exist, it returns the empty string.
          If `commit_sha` is provided, that will be checked out and returned.
              otherwise the branch will be checked out.