Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit 0b34d1c

Browse files
committed
Improve names and formatting
1 parent fbe55cb commit 0b34d1c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tools/ci/update_pr_preview.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,25 @@ def _make_temp_repo(self):
9191
finally:
9292
shutil.rmtree(directory)
9393

94-
def get_revision(self, name):
94+
def get_revision(self, refspec):
9595
output = subprocess.check_output([
9696
'git',
9797
'ls-remote',
9898
self._url,
99-
'refs/{}'.format(name)
99+
'refs/{}'.format(refspec)
100100
])
101101

102102
if not output:
103103
return None
104104

105105
return output.split()[0]
106106

107-
def delete_ref(self, name):
108-
args = ['git', 'push', self._url, '--delete', 'refs/{}'.format(name)]
107+
def delete_ref(self, refspec):
109108
with self._make_temp_repo() as temp_repo:
110-
subprocess.check_call(args, cwd=temp_repo)
109+
subprocess.check_call(
110+
['git', 'push', self._url, '--delete', 'refs/{}'.format(refspec)],
111+
cwd=temp_repo
112+
)
111113

112114
def main(host, organization, repository):
113115
# > Accessing this endpoint does not count against your REST API rate limit.

0 commit comments

Comments
 (0)