Commit
·
c4d6e89
1
Parent(s):
6f246a1
Update get_commits.py
Browse files- get_commits.py +3 -2
get_commits.py
CHANGED
@@ -14,8 +14,9 @@ git checkout FETCH_HEAD^ -- README.md
|
|
14 |
"""
|
15 |
|
16 |
#Shell utils
|
17 |
-
def run_in_shell(cmd: str, cwd=None):
|
18 |
-
|
|
|
19 |
return completed
|
20 |
|
21 |
def get_file_contents(commit, old_file, new_file, repo, cwd=None):
|
|
|
14 |
"""
|
15 |
|
16 |
#Shell utils
|
17 |
+
def run_in_shell(cmd: str, cwd=None, timeout=120):
|
18 |
+
# Default 2min timeout (mostly for git fetch --depth 2 origin when the repo is private & GH asks for a username)
|
19 |
+
completed = subprocess.run([cmd], capture_output=True, shell=True, cwd=cwd, timeout=timeout)
|
20 |
return completed
|
21 |
|
22 |
def get_file_contents(commit, old_file, new_file, repo, cwd=None):
|