-
Notifications
You must be signed in to change notification settings - Fork 5
Add git config #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add git config #77
Conversation
| { | ||
| if (m_name.empty()) | ||
| { | ||
| std::cout << "error: wrong number of arguments, should be 1" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this raise an exception rather than just write to cout, so that git2cpp exits with a non-zero exit code? git gives an exit code of 129.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch
| { | ||
| if (m_name.empty() | m_value.empty()) | ||
| { | ||
| std::cout << "error: wrong number of arguments, should be 2" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception here too.
| { | ||
| if (m_name.empty()) | ||
| { | ||
| std::cout << "error: wrong number of arguments, should be 1" << std::endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exception here too.
| import pytest | ||
|
|
||
|
|
||
| def test_config_list(commit_env_config, git2cpp_path, tmp_path, monkeypatch): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't actually need the monkeypatch to be specified here, it will be used anyway. Probably we've done the same in lots of other places, I guess it can be future work to go through and remove the unwanted ones or perhaps a python linter will do this for us eventually.
| cmd_get = [git2cpp_path, "config", "get", "core.bare"] | ||
| p_get = subprocess.run(cmd_get, capture_output=True, cwd=tmp_path, text=True) | ||
| assert p_get.returncode == 0 | ||
| print(p_get.stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debug print can be removed?
Add
git configsub-command.git config listgit config setgit config getgit config unset