def _read_alternate_paths(self): try: f = GitFile(os.path.join(self.path, INFODIR, "alternates"), "rb") except FileNotFoundError: return with f: for line in f.readlines(): line = line.rstrip(b"\n") if line.startswith(b"#"): continue if os.path.isabs(line): yield os.fsdecode(line) else: yield os.fsdecode(os.path.join(os.fsencode(self.path), line))
def _read_alternate_paths(self): try: f = GitFile(os.path.join(self.path, INFODIR, b'alternates'), 'rb') except (OSError, IOError) as e: if e.errno == errno.ENOENT: return raise with f: for l in f.readlines(): l = l.rstrip(b"\n") if l[0] == b"#": continue if os.path.isabs(l): yield l else: yield os.path.join(self.path, l)
def _read_alternate_paths(self): try: f = GitFile(os.path.join(self.path, INFODIR, "alternates"), "rb") except (OSError, IOError) as e: if e.errno == errno.ENOENT: return raise with f: for l in f.readlines(): l = l.rstrip(b"\n") if l[0] == b"#": continue if os.path.isabs(l): yield l.decode(sys.getfilesystemencoding()) else: yield os.path.join(self.path, l).decode(sys.getfilesystemencoding())
def _read_alternate_paths(self): try: f = GitFile(os.path.join(self.path, INFODIR, "alternates"), 'rb') except (OSError, IOError) as e: if e.errno == errno.ENOENT: return raise with f: for line in f.readlines(): line = line.rstrip(b"\n") if line[0] == b"#": continue if os.path.isabs(line): yield line.decode(sys.getfilesystemencoding()) else: yield os.path.join(self.path, line).decode( sys.getfilesystemencoding())
def _read_alternate_paths(self): try: f = GitFile(os.path.join(self.path, "info", "alternates"), 'rb') except (OSError, IOError) as e: if e.errno == errno.ENOENT: return [] raise ret = [] with f: for l in f.readlines(): l = l.rstrip("\n") if l[0] == "#": continue if os.path.isabs(l): ret.append(l) else: ret.append(os.path.join(self.path, l)) return ret