Skip to content

Commit 0c6cf9f

Browse files
committed
fix: set GIT_TERMINAL_PROMPT to 0
When cloning a non-existent repository, git prompts for a username and password, which is not appropriate in a CI environment such as buildit.
1 parent d4fea8f commit 0c6cf9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

acbs/fetch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,14 +178,14 @@ def blob_processor(package: ACBSPackageInfo, index: int, source_name: str) -> No
178178
def git_fetch(info: ACBSSourceInfo, source_location: str, name: str) -> Optional[ACBSSourceInfo]:
179179
full_path = os.path.join(source_location, name)
180180
if not os.path.exists(full_path):
181-
subprocess.check_call(['git', 'clone', '--bare', '--filter=blob:none', info.url, full_path], env={'GIT_TERMINAL_PROMPT': '1'})
181+
subprocess.check_call(['git', 'clone', '--bare', '--filter=blob:none', info.url, full_path], env={'GIT_TERMINAL_PROMPT': '0'})
182182
else:
183183
logging.info('Updating repository...')
184184
# --prune: prune remote-tracking branches no longer on remote
185185
# --tags: fetch all tags and associated objects
186186
# --force: force overwrite of local reference
187187
subprocess.check_call(
188-
['git', 'fetch', 'origin', '+refs/heads/*:refs/heads/*', '--prune', '--tags', '--force'], cwd=full_path, env={'GIT_TERMINAL_PROMPT': '1'})
188+
['git', 'fetch', 'origin', '+refs/heads/*:refs/heads/*', '--prune', '--tags', '--force'], cwd=full_path, env={'GIT_TERMINAL_PROMPT': '0'})
189189
info.source_location = full_path
190190
return info
191191

0 commit comments

Comments
 (0)