Merge pull request #557 from iorisa/fixbug/git_repo_shenquan

fixbug: gitignore error after project renamed
This commit is contained in:
geekan 2023-12-14 10:26:42 +08:00 committed by GitHub
commit e6102bc31f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -204,6 +204,7 @@ class GitRepository:
logger.warning(f"Move {str(self.workdir)} to {str(new_path)} error: {e}")
logger.info(f"Rename directory {str(self.workdir)} to {str(new_path)}")
self._repository = Repo(new_path)
self._gitignore_rules = parse_gitignore(full_path=str(new_path / ".gitignore"))
def get_files(self, relative_path: Path | str, root_relative_path: Path | str = None, filter_ignored=True) -> List:
"""