diff options
Diffstat (limited to 'subplot/jt.py')
-rw-r--r-- | subplot/jt.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/subplot/jt.py b/subplot/jt.py index d6023b3..0117736 100644 --- a/subplot/jt.py +++ b/subplot/jt.py @@ -166,3 +166,16 @@ def file_name_has_suffix(ctx, varname=None, suffix=None): variables = ctx.get("variables", {}) filename = variables[varname] assert filename.endswith(suffix) + + +def git_is_clean(ctx, dirname=None): + runcmd_run = globals()["runcmd_run"] + runcmd_exit_code_is_zero = globals()["runcmd_exit_code_is_zero"] + runcmd_get_stdout = globals()["runcmd_get_stdout"] + assert_eq = globals()["assert_eq"] + + runcmd_run(ctx, ["git", "status", "--porcelain"], cwd=dirname) + runcmd_exit_code_is_zero(ctx) + + stdout = runcmd_get_stdout(ctx) + assert_eq(stdout, "") |