Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/subcommand/checkout_subcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void checkout_subcommand::run()
annotated_commit_wrapper checkout_subcommand::create_local_branch
(
repository_wrapper& repo,
const std::string& target_name,
const std::string_view target_name,
bool force
)
{
Expand All @@ -71,7 +71,7 @@ void checkout_subcommand::checkout_tree
(
const repository_wrapper& repo,
const annotated_commit_wrapper& target_annotated_commit,
const std::string& target_name,
const std::string_view target_name,
const git_checkout_options& options
)
{
Expand All @@ -83,7 +83,7 @@ void checkout_subcommand::update_head
(
repository_wrapper& repo,
const annotated_commit_wrapper& target_annotated_commit,
const std::string& target_name
const std::string_view target_name
)
{
std::string_view annotated_ref = target_annotated_commit.reference_name();
Expand Down
6 changes: 3 additions & 3 deletions src/subcommand/checkout_subcommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ class checkout_subcommand
annotated_commit_wrapper create_local_branch
(
repository_wrapper& repo,
const std::string& target_name,
const std::string_view target_name,
bool force
);

void checkout_tree
(
const repository_wrapper& repo,
const annotated_commit_wrapper& target_annotated_commit,
const std::string& target_name,
const std::string_view target_name,
const git_checkout_options& options
);

void update_head
(
repository_wrapper& repo,
const annotated_commit_wrapper& target_annotated_commit,
const std::string& target_name
const std::string_view target_name
);

std::string m_branch_name = {};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/git_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void throw_if_error(int exit_code)
}


git_exception::git_exception(const std::string& message, int error_code)
git_exception::git_exception(const std::string_view message, int error_code)
: m_message(message), m_error_code(error_code)
{}

Expand Down
4 changes: 3 additions & 1 deletion src/utils/git_exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ void throw_if_error(int exit_code);
class git_exception : public std::exception
{
public:
git_exception(const std::string& message, int error_code);

git_exception(const std::string_view message, int error_code);

int error_code() const;

const char* what() const noexcept override;

private:

std::string m_message;
int m_error_code;
};