-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Fix hub when branch name contains slash. #27960
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
Conversation
| # To check if cached repo exists, we need to normalize folder names. | ||
| repo_dir = os.path.join(hub_dir, '_'.join([repo_owner, repo_name, branch])) | ||
| normalized_br = branch.replace('/', '_') | ||
| repo_dir = os.path.join(hub_dir, '_'.join([repo_owner, repo_name, normalized_br])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the replace trick here works in a portable way; should we look into e.g. os.sep or how other folks handle this normalization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we can just hash the branch name if there is no reason why we should keep the original naming around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point about windows! ;) Yea I'll switch to os.sep and try to make a test for it.
We might prefer to keep the branch name so that we can reuse cache, hashing will make the cache not discoverable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually I just tried, github doesn't allow backslash in branch name, so we are good here. ;)
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ailzhang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: fixes pytorch#27844 Pull Request resolved: pytorch#27960 Differential Revision: D17964360 Pulled By: ailzhang fbshipit-source-id: f5054fc251d2ebbf09ea4ea9fa4d1ce87db5fc52
fixes #27844