def oid_diff(git, oid, filename=None):
 args = [(oid + u'~'), oid]
 opts = common_diff_opts()
 _add_filename(args, filename)
 (status, out, err) = git.diff(*args, **opts)
 if (status != 0):
  args = [(oid + u'^!')]
  _add_filename(args, filename)
  (status, out, err) = git.show(pretty=u'format:', *args, **opts)
  out = out.lstrip()
 return out

def oid_diff ( git , oid , filename = None ) : args = [ ( oid + u'~' ) , oid ] opts = common_diff_opts ( ) _add_filename ( args , filename ) ( status , out , err ) = git . diff ( * args , ** opts ) if ( status != 0 ) : args = [ ( oid + u'^!' ) ] _add_filename ( args , filename ) ( status , out , err ) = git . show ( pretty = u'format:' , * args , ** opts ) out = out . lstrip ( ) return out
return the diff for an oid .