def stashes(self): reflog_path = os.path.join( self._repo.commondir(), 'logs', self._ref) try: with GitFile(reflog_path, 'rb') as f: return reversed(list(read_reflog(f))) except FileNotFoundError: return []
def stashes(self): reflog_path = os.path.join(self._repo.commondir(), "logs", os.fsdecode(self._ref)) try: with GitFile(reflog_path, "rb") as f: return reversed(list(read_reflog(f))) except FileNotFoundError: return []
def stashes(self): reflog_path = os.path.join(self._repo.commondir(), 'logs', self._ref) try: with GitFile(reflog_path, 'rb') as f: return reversed(list(read_reflog(f))) except EnvironmentError as e: if e.errno == errno.ENOENT: return [] raise
def stashes(self): reflog_path = os.path.join( self._repo.commondir(), 'logs', self._ref) try: with GitFile(reflog_path, 'rb') as f: return reversed(list(read_reflog(f))) except EnvironmentError as e: if e.errno == errno.ENOENT: return [] raise
def stashes(self): try: with GitFile(self._reflog_path, "rb") as f: return reversed(list(read_reflog(f))) except FileNotFoundError: return []
def _read_log(self): self.f.seek(0) return list(read_reflog(self.f))
def setUp(self): TestCase.setUp(self) self.f = BytesIO(_TEST_REFLOG) self.original_log = list(read_reflog(self.f)) self.f.seek(0)