Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #39 d2lbook translate failure #40

Merged
merged 2 commits into from
Jan 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions d2lbook/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def __init__(self, cf: config.Config, commit: str):
if os.path.exists(self.repo_dir):
self.repo = git.Repo(self.repo_dir)
logging.info(f'Pulling from {self.url} into {self.repo_dir}')
# reset to origin/master before pulling updates
AnirudhDagar marked this conversation as resolved.
Show resolved Hide resolved
self.repo.git.reset('--hard', self.repo.remotes.origin.name + '/' + self.repo.active_branch.name)
self.repo.remotes.origin.pull()
else:
logging.info(f'Clone {self.url} into {self.repo_dir}')
Expand Down