Skip to content

Commit ab65394

Browse files
bigfootjonfacebook-github-bot
authored andcommitted
[pytorch][require export] Create smartplatform configuration for trymerge (pytorch#75542)
Summary: Pull Request resolved: pytorch#75542 Reviewed By: malfet Differential Revision: D35513051 fbshipit-source-id: adf59359fcf2410fa8a61746533c896ec22d5ed3
1 parent 97a4e52 commit ab65394

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/scripts/gitutils.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python3
22

3+
import os
4+
import re
5+
import tempfile
36
from collections import defaultdict
47
from datetime import datetime
58
from typing import cast, Any, Dict, Iterator, List, Optional, Tuple, Union
6-
import os
7-
import re
89

910

1011
RE_GITHUB_URL_MATCH = re.compile("^https://.*@?github.com/(.+)/(.+)$")
@@ -260,6 +261,12 @@ def amend_commit_message(self, msg: str) -> None:
260261
self._run_git("commit", "--amend", "-m", msg)
261262

262263

264+
def clone_repo(username: str, password: str, org: str, project: str) -> GitRepo:
265+
path = tempfile.mkdtemp()
266+
_check_output(['git', 'clone', f'https://{username}:{password}@github.com/{org}/{project}', path]).strip()
267+
return GitRepo(path=path)
268+
269+
263270
class PeekableIterator(Iterator[str]):
264271
def __init__(self, val: str) -> None:
265272
self._val = val

0 commit comments

Comments
 (0)