Skip to content

Commit 6a5aa0e

Browse files
committed
remove unnecessary variables and f-strings (NO_JIRA)
1 parent 4b62aa9 commit 6a5aa0e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

main/githooks.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def get_sha():
146146
GITHUB_SHA cannot be used because in a pull request it gives the sha of the
147147
fake merge commit.
148148
'''
149-
return _get_output(['git','rev-parse', f'{get_branch()}'])
149+
return _get_output(['git','rev-parse', get_branch()])
150150

151151

152152
def get_event():
@@ -159,13 +159,12 @@ def get_event():
159159

160160
def get_branch_files():
161161
'''Get all files in branch'''
162-
branch = get_branch()
163-
return _get_output(['git','ls-tree', '-r', f'{branch}','--name-only']).splitlines()
162+
return _get_output(['git','ls-tree', '-r', get_branch(),'--name-only']).splitlines()
164163

165164

166165
def add_file_to_index(filename):
167166
'''Add file to current commit'''
168-
return _get_output(['git','add',f'{filename}'])
167+
return _get_output(['git','add',filename])
169168

170169

171170
def get_commit_files():
@@ -284,7 +283,7 @@ def _test(input, output):
284283
def get_config_setting(setting):
285284
'''Get the value of a config setting'''
286285
try:
287-
return _get_output(['git', 'config', '--get', f'{setting}']).strip()
286+
return _get_output(['git', 'config', '--get', setting]).strip()
288287
except subprocess.CalledProcessError:
289288
return None
290289

0 commit comments

Comments
 (0)