-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcheckout_subcommand.hpp
More file actions
40 lines (30 loc) · 965 Bytes
/
checkout_subcommand.hpp
File metadata and controls
40 lines (30 loc) · 965 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <optional>
#include <string>
#include <CLI/CLI.hpp>
#include "../utils/common.hpp"
#include "../wrapper/repository_wrapper.hpp"
class checkout_subcommand
{
public:
explicit checkout_subcommand(const libgit2_object&, CLI::App& app);
void run();
private:
annotated_commit_wrapper
create_local_branch(repository_wrapper& repo, 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_view target_name,
const git_checkout_options& options
);
void update_head(
repository_wrapper& repo,
const annotated_commit_wrapper& target_annotated_commit,
const std::string_view target_name
);
std::string m_branch_name = {};
bool m_create_flag = false;
bool m_force_create_flag = false;
bool m_force_checkout_flag = false;
};