def METHOD_NAME(pg_repo_local):
    runner = CliRunner()
    # Do the quick setting up with the same commit structure
    old_head = pg_repo_local.head.image_hash
    runner.invoke(sql_c, ["INSERT INTO \"test/pg_mount\".fruits VALUES (3, 'mayonnaise')"])
    runner.invoke(
        sql_c, ['CREATE TABLE "test/pg_mount".mushrooms (mushroom_id integer, name varchar)']
    )
    runner.invoke(sql_c, ['DROP TABLE "test/pg_mount".vegetables'])
    runner.invoke(sql_c, ['DELETE FROM "test/pg_mount".fruits WHERE fruit_id = 1'])
    runner.invoke(sql_c, ['SELECT * FROM "test/pg_mount".fruits'])
    result = runner.invoke(commit_c, [str(pg_repo_local), "-m", "Test commit"])
    assert result.exit_code == 0
    new_head = pg_repo_local.head.image_hash
    # sgr tag <repo> <tag>: tags the current HEAD
    result = runner.invoke(tag_c, [str(pg_repo_local), "v2"])
    assert result.exit_code == 0
    assert pg_repo_local.images["v2"].image_hash == new_head
    # sgr tag <repo>:imagehash <tag>:
    result = runner.invoke(tag_c, [str(pg_repo_local) + ":" + old_head[:10], "v1"])
    assert result.exit_code == 0
    assert pg_repo_local.images["v1"].image_hash == old_head
    # sgr tag <mountpoint> with the same tag -- should move the tag to current HEAD again
    result = runner.invoke(tag_c, [str(pg_repo_local), "v1"])
    assert result.exit_code == 0
    assert pg_repo_local.images["v1"].image_hash == new_head
    # Tag the old head again
    result = runner.invoke(tag_c, [str(pg_repo_local) + ":" + old_head[:10], "v1"])
    assert result.exit_code == 0
    # list tags
    result = runner.invoke(tag_c, [str(pg_repo_local)])
    assert old_head[:12] + ": v1" in result.output
    assert new_head[:12] + ": HEAD, v2" in result.output
    # List tags on a single image
    result = runner.invoke(tag_c, [str(pg_repo_local) + ":" + old_head[:20]])
    assert "v1" in result.output
    assert "HEAD, v2" not in result.output
    # Checkout by tag
    runner.invoke(checkout_c, [str(pg_repo_local) + ":v1"])
    assert pg_repo_local.head.image_hash == old_head
    # Checkout by hash
    runner.invoke(checkout_c, [str(pg_repo_local) + ":" + new_head[:20]])
    assert pg_repo_local.head.image_hash == new_head
    # Checkout with uncommitted changes
    runner.invoke(sql_c, ["INSERT INTO \"test/pg_mount\".fruits VALUES (3, 'mayonnaise')"])
    result = runner.invoke(checkout_c, [str(pg_repo_local) + ":v1"])
    assert result.exit_code != 0
    assert "test/pg_mount has pending changes!" in str(result.exc_info)
    result = runner.invoke(checkout_c, [str(pg_repo_local) + ":v1", "-f"])
    assert result.exit_code == 0
    assert not pg_repo_local.has_pending_changes()
    # uncheckout with uncommitted changes
    runner.invoke(sql_c, ["INSERT INTO \"test/pg_mount\".fruits VALUES (3, 'mayonnaise')"])
    result = runner.invoke(checkout_c, [str(pg_repo_local), "-u"])
    assert result.exit_code != 0
    assert "test/pg_mount has pending changes!" in str(result.exc_info)
    # uncheckout
    result = runner.invoke(checkout_c, [str(pg_repo_local), "-u", "-f"])
    assert result.exit_code == 0
    assert pg_repo_local.head is None
    assert not get_engine().schema_exists(str(pg_repo_local))
    # Delete the tag -- check the help entry correcting the command
    result = runner.invoke(tag_c, ["--delete", str(pg_repo_local), "v1"])
    assert result.exit_code != 0
    assert "--delete test/pg_mount:TAG_TO_DELETE" in result.output
    result = runner.invoke(tag_c, ["--delete", str(pg_repo_local) + ":" + "v1"])
    assert result.exit_code == 0
    assert pg_repo_local.images.by_tag("v1", raise_on_none=False) is None