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: 2 additions & 0 deletions gto/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ def show( # pylint: disable=too-many-locals
arg = "stage" if show_stage else arg
arg = "ref" if show_ref else arg
if arg:
if not output[0]:
return
if arg not in output[0][0]:
raise WrongArgs(f"Cannot apply --{arg}")
format_echo(
Expand Down
5 changes: 5 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ def test_show_ref_flag_not_applicable(repo_with_commit: str):
)


def test_show_line_flag_empty_result():
with mock.patch("gto.api.show", return_value=([], "keys")):
_check_successful_cmd("show", ["-r", ".", "m5#missing", "--version"], "")


def test_history_json_empty(repo_with_commit: str):
_check_successful_cmd("history", ["-r", repo_with_commit, "--json"], "[]\n")

Expand Down
Loading