We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d698b28 commit 7752c8aCopy full SHA for 7752c8a
src/subcommand/config_subcommand.cpp
@@ -56,8 +56,7 @@ void config_subcommand::run_get()
56
{
57
if (m_name.empty())
58
59
- std::cout << "error: wrong number of arguments, should be 1" << std::endl;
60
- return;
+ throw git_exception("error: wrong number of arguments, should be 1", 129);
61
}
62
63
auto directory = get_current_git_path();
@@ -74,8 +73,7 @@ void config_subcommand::run_set()
74
73
75
if (m_name.empty() | m_value.empty())
76
77
- std::cout << "error: wrong number of arguments, should be 2" << std::endl;
78
+ throw git_exception("error: wrong number of arguments, should be 2", 129);
79
80
81
@@ -89,8 +87,7 @@ void config_subcommand::run_unset()
89
87
90
88
91
92
93
94
95
96
test/test_config.py
@@ -3,7 +3,7 @@
3
import pytest
4
5
6
-def test_config_list(commit_env_config, git2cpp_path, tmp_path, monkeypatch):
+def test_config_list(commit_env_config, git2cpp_path, tmp_path):
7
cmd_init = [git2cpp_path, "init", "--bare", str(tmp_path)]
8
p_init = subprocess.run(cmd_init, capture_output=True)
9
assert p_init.returncode == 0
@@ -23,11 +23,10 @@ def test_config_get(git2cpp_path, tmp_path):
23
cmd_get = [git2cpp_path, "config", "get", "core.bare"]
24
p_get = subprocess.run(cmd_get, capture_output=True, cwd=tmp_path, text=True)
25
assert p_get.returncode == 0
26
- print(p_get.stdout)
27
assert p_get.stdout == "true\n"
28
29
30
-def test_config_set(commit_env_config, git2cpp_path, tmp_path, monkeypatch):
+def test_config_set(commit_env_config, git2cpp_path, tmp_path):
31
32
33
0 commit comments