MCPcopy Create free account
hub / github.com/gitless-vcs/gitless / process_paths

Method process_paths

gitless/cli/helpers.py:116–137  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

114 root = self.repo.root if self.repo else ''
115 repo_dir = self.repo.path[:-1] if self.repo else '' # strip trailing /
116 def process_paths():
117 for path in paths:
118 path = os.path.abspath(path)
119 if self.recursive and os.path.isdir(path):
120 for curr_dir, dirs, fps in os.walk(path, topdown=True):
121 if curr_dir.startswith(repo_dir):
122 dirs[:] = []
123 continue
124 curr_dir_rel = os.path.relpath(curr_dir, root)
125 if (curr_dir_rel != "." and self.skip_dir_test and
126 self.skip_dir_test(curr_dir_rel)):
127 if self.skip_dir_cb:
128 self.skip_dir_cb(curr_dir_rel)
129 dirs[:] = []
130 continue
131 for fp in fps:
132 yield os.path.join(curr_dir_rel, fp)
133 else:
134 if not path.startswith(repo_dir):
135 yield os.path.relpath(path, root)
136 else:
137 yield path
138
139 setattr(namespace, self.dest, process_paths())
140

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected