Skip to content

Commit

Permalink
metrics: diff: don't print "No changes"
Browse files Browse the repository at this point in the history
Makes it easier to use in shell scripts. E.g. `-z $(dvc metrics diff)`, which
has the same semantics as `git diff`. Also syncs up with the behaviour
of `dvc diff`.

Fixes iterative#3469
  • Loading branch information
efiop committed Apr 2, 2020
1 parent a338fad commit d821fa7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dvc/command/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def _show_diff(diff):
from texttable import Texttable

if not diff:
return "No changes."
return ""

table = Texttable()

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/command/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_metrics_diff_no_diff():


def test_metrics_diff_no_changes():
assert _show_diff({}) == "No changes."
assert _show_diff({}) == ""


def test_metrics_diff_new_metric():
Expand Down

0 comments on commit d821fa7

Please sign in to comment.