codeflash error handle when remote is empty
Some checks failed
CodeFlash / Optimize new code in this PR (pull_request) Failing after 1s
end-to-end-test / bubble-sort-optimization-pytest-no-git (pull_request) Failing after 1s
end-to-end-test / bubble-sort-optimization-unittest (pull_request) Failing after 2s
Coverage E2E / end-to-end-test-coverage (pull_request) Failing after 2s
end-to-end-test / futurehouse-structure (pull_request) Failing after 2s
end-to-end-test / init-optimization (pull_request) Failing after 2s
end-to-end-test / tracer-replay (pull_request) Failing after 2s
end-to-end-test / topological-sort-optimization (pull_request) Failing after 2s
Mypy Type Checking for CLI / type-check-cli (pull_request) Failing after 2s
unit-tests / unit-tests (3.10.13) (pull_request) Failing after 2s
unit-tests / unit-tests (3.11.6) (pull_request) Failing after 1s
unit-tests / unit-tests (3.12.1) (pull_request) Failing after 2s
unit-tests / unit-tests (3.13.0) (pull_request) Failing after 2s
unit-tests / unit-tests (3.9.18) (pull_request) Failing after 2s
Some checks failed
CodeFlash / Optimize new code in this PR (pull_request) Failing after 1s
end-to-end-test / bubble-sort-optimization-pytest-no-git (pull_request) Failing after 1s
end-to-end-test / bubble-sort-optimization-unittest (pull_request) Failing after 2s
Coverage E2E / end-to-end-test-coverage (pull_request) Failing after 2s
end-to-end-test / futurehouse-structure (pull_request) Failing after 2s
end-to-end-test / init-optimization (pull_request) Failing after 2s
end-to-end-test / tracer-replay (pull_request) Failing after 2s
end-to-end-test / topological-sort-optimization (pull_request) Failing after 2s
Mypy Type Checking for CLI / type-check-cli (pull_request) Failing after 2s
unit-tests / unit-tests (3.10.13) (pull_request) Failing after 2s
unit-tests / unit-tests (3.11.6) (pull_request) Failing after 1s
unit-tests / unit-tests (3.12.1) (pull_request) Failing after 2s
unit-tests / unit-tests (3.13.0) (pull_request) Failing after 2s
unit-tests / unit-tests (3.9.18) (pull_request) Failing after 2s
This commit is contained in:
parent
2f81f2caab
commit
de6b7aae1c
1 changed files with 16 additions and 9 deletions
|
|
@ -220,19 +220,26 @@ def collect_setup_info() -> SetupInfo:
|
|||
carousel=True,
|
||||
)
|
||||
|
||||
git_remote = ""
|
||||
try:
|
||||
repo = Repo(str(module_root), search_parent_directories=True)
|
||||
git_remotes = get_git_remotes(repo)
|
||||
if len(git_remotes) > 1:
|
||||
git_remote = inquirer_wrapper(
|
||||
inquirer.list_input,
|
||||
message="What git remote do you want Codeflash to use for new Pull Requests? ",
|
||||
choices=git_remotes,
|
||||
default="origin",
|
||||
carousel=True,
|
||||
)
|
||||
if git_remotes: # Only proceed if there are remotes
|
||||
if len(git_remotes) > 1:
|
||||
git_remote = inquirer_wrapper(
|
||||
inquirer.list_input,
|
||||
message="What git remote do you want Codeflash to use for new Pull Requests? ",
|
||||
choices=git_remotes,
|
||||
default="origin",
|
||||
carousel=True,
|
||||
)
|
||||
else:
|
||||
git_remote = git_remotes[0]
|
||||
else:
|
||||
git_remote = git_remotes[0]
|
||||
click.echo(
|
||||
"No git remotes found. You can still use Codeflash locally, but you'll need to set up a remote "
|
||||
"repository to use GitHub features."
|
||||
)
|
||||
except InvalidGitRepositoryError:
|
||||
git_remote = ""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue