Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion comfy_cli/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def install(
)
raise typer.Exit(code=1)

if pr and version not in {None, "nightly"} or commit:
if pr and (version not in {None, "nightly"} or commit):
rprint("--pr cannot be used with --version or --commit")
raise typer.Exit(code=1)
Comment thread
bigcat88 marked this conversation as resolved.
Comment thread
bigcat88 marked this conversation as resolved.

Expand Down
14 changes: 14 additions & 0 deletions tests/comfy_cli/command/github/test_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,20 @@ def test_pr_and_commit_conflict(self, runner):

assert result.exit_code != 0

@patch("comfy_cli.command.install.execute")
@patch("comfy_cli.cmdline.check_comfy_repo", return_value=(False, None))
@patch("comfy_cli.cmdline.workspace_manager")
@patch("comfy_cli.tracking.prompt_tracking_consent")
def test_commit_without_pr_does_not_conflict(self, mock_track, mock_ws, mock_check, mock_execute, runner):
"""Test that --commit alone does not trigger --pr conflict error (issue #335)"""
mock_ws.get_workspace_path.return_value = ("/tmp/test", None)
result = runner.invoke(
app, ["--skip-prompt", "install", "--version", "nightly", "--commit", "abc123", "--nvidia"]
)

Comment thread
bigcat88 marked this conversation as resolved.
assert "--pr cannot be used" not in result.stdout
assert mock_execute.called


class TestPRInfoDataClass:
"""Test PRInfo data class"""
Expand Down
Loading