File tree Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Expand file tree Collapse file tree 4 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ void checkout_subcommand::run()
5959annotated_commit_wrapper checkout_subcommand::create_local_branch
6060(
6161 repository_wrapper& repo,
62- const std::string& target_name,
62+ const std::string_view target_name,
6363 bool force
6464)
6565{
@@ -71,7 +71,7 @@ void checkout_subcommand::checkout_tree
7171(
7272 const repository_wrapper& repo,
7373 const annotated_commit_wrapper& target_annotated_commit,
74- const std::string& target_name,
74+ const std::string_view target_name,
7575 const git_checkout_options& options
7676)
7777{
@@ -83,7 +83,7 @@ void checkout_subcommand::update_head
8383(
8484 repository_wrapper& repo,
8585 const annotated_commit_wrapper& target_annotated_commit,
86- const std::string& target_name
86+ const std::string_view target_name
8787)
8888{
8989 std::string_view annotated_ref = target_annotated_commit.reference_name ();
Original file line number Diff line number Diff line change @@ -20,23 +20,23 @@ class checkout_subcommand
2020 annotated_commit_wrapper create_local_branch
2121 (
2222 repository_wrapper& repo,
23- const std::string& target_name,
23+ const std::string_view target_name,
2424 bool force
2525 );
2626
2727 void checkout_tree
2828 (
2929 const repository_wrapper& repo,
3030 const annotated_commit_wrapper& target_annotated_commit,
31- const std::string& target_name,
31+ const std::string_view target_name,
3232 const git_checkout_options& options
3333 );
3434
3535 void update_head
3636 (
3737 repository_wrapper& repo,
3838 const annotated_commit_wrapper& target_annotated_commit,
39- const std::string& target_name
39+ const std::string_view target_name
4040 );
4141
4242 std::string m_branch_name = {};
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ void throw_if_error(int exit_code)
1111}
1212
1313
14- git_exception::git_exception (const std::string& message, int error_code)
14+ git_exception::git_exception (const std::string_view message, int error_code)
1515 : m_message(message), m_error_code(error_code)
1616{}
1717
Original file line number Diff line number Diff line change @@ -8,13 +8,15 @@ void throw_if_error(int exit_code);
88class git_exception : public std ::exception
99{
1010public:
11- git_exception (const std::string& message, int error_code);
11+
12+ git_exception (const std::string_view message, int error_code);
1213
1314 int error_code () const ;
1415
1516 const char * what () const noexcept override ;
1617
1718private:
19+
1820 std::string m_message;
1921 int m_error_code;
2022};
You can’t perform that action at this time.
0 commit comments