-
Notifications
You must be signed in to change notification settings - Fork 5
Add diff subcommand #87
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
Conversation
2acbb53 to
e8e7b97
Compare
|
When building locally on macos I see /Users/iant/github/git2cpp/src/utils/common.cpp:114:23: error: implicit instantiation of undefined template 'std::basic_stringstream<char>'
114 | std::stringstream buffer;
| ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__fwd/sstream.h:30:28: note: template is declared here
30 | class _LIBCPP_TEMPLATE_VIS basic_stringstream;
| ^
1 error generated.To fix this I need to add |
| if (repo.state() != GIT_REPOSITORY_STATE_NONE) | ||
| { | ||
| throw std::runtime_error("Cannot checkout, repository is in unexpected state"); | ||
| std::runtime_error("Cannot checkout, repository is in unexpected state"); |
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.
It looks like was deleted by accident?
src/subcommand/diff_subcommand.cpp
Outdated
|
|
||
| static int colour_printer([[maybe_unused]] const git_diff_delta* delta, [[maybe_unused]] const git_diff_hunk* hunk, const git_diff_line* line, void* payload) | ||
| { | ||
| bool* use_colour = reinterpret_cast<bool*>(payload); |
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.
I think it would be better to store bool use_colour rather than bool*. As it stands, later in this function both *use_colour and use_colour (without the dereference) are used, and they can't both work correctly!
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Add diff subcommand