Skip to content

Commit 893eec9

Browse files
committed
address review comments
1 parent d232da9 commit 893eec9

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

src/subcommand/add_subcommand.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ add_subcommand::add_subcommand(const libgit2_object&, CLI::App& app)
99
{
1010
auto *sub = app.add_subcommand("add", "Add file contents to the index");
1111

12-
sub->add_option("files", add_files, "Files to add");
12+
sub->add_option("files", m_add_files, "Files to add");
1313

14-
sub->add_flag("-A,--all,--no-ignore-removal", all_flag, "");
14+
sub->add_flag("-A,--all,--no-ignore-removal", m_all_flag, "");
1515
// sub->add_flag("-n,--dryrun", dryrun_flag, "");
1616
// sub->add_flag("-u,--update", update_flag, "");
1717
// sub->add_flag("-v,--verbose", verbose_flag, "");
@@ -28,12 +28,12 @@ void add_subcommand::run()
2828

2929
index_wrapper index = repo.make_index();
3030

31-
if (all_flag)
31+
if (m_all_flag)
3232
{
3333
index.add_all();
3434
}
3535
else
3636
{
37-
index.add_entries(add_files);
37+
index.add_entries(m_add_files);
3838
}
3939
}

src/subcommand/add_subcommand.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ class add_subcommand
1212
void run();
1313

1414
private:
15-
bool all_flag = false;
16-
std::vector<std::string> add_files;
15+
bool m_all_flag = false;
16+
std::vector<std::string> m_add_files;
1717
};

src/subcommand/init_subcommand.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ init_subcommand::init_subcommand(const libgit2_object&, CLI::App& app)
66
{
77
auto *sub = app.add_subcommand("init", "Explanation of init here");
88

9-
sub->add_flag("--bare", bare, "info about bare arg");
9+
sub->add_flag("--bare", m_bare, "info about bare arg");
1010

1111
// If directory not specified, uses cwd.
12-
sub->add_option("directory", directory, "info about directory arg")
12+
sub->add_option("directory", m_directory, "info about directory arg")
1313
->check(CLI::ExistingDirectory | CLI::NonexistentPath)
1414
->default_val(get_current_git_path());
1515

@@ -18,5 +18,5 @@ init_subcommand::init_subcommand(const libgit2_object&, CLI::App& app)
1818

1919
void init_subcommand::run()
2020
{
21-
repository_wrapper::init(directory, bare);
21+
repository_wrapper::init(m_directory, m_bare);
2222
}

src/subcommand/init_subcommand.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ class init_subcommand
1414
void run();
1515

1616
private:
17-
bool bare;
18-
std::string directory;
17+
bool m_bare;
18+
std::string m_directory;
1919
};

src/subcommand/status_subcommand.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ status_subcommand::status_subcommand(const libgit2_object&, CLI::App& app)
1414
{
1515
auto *sub = app.add_subcommand("status", "Show modified files in working directory, staged for your next commit");
1616

17-
sub->add_flag("-s,--short", short_flag, "Give the output in the short-format.");
18-
sub->add_flag("--long", long_flag, "Give the output in the long-format. This is the default.");
17+
sub->add_flag("-s,--short", m_short_flag, "Give the output in the short-format.");
18+
sub->add_flag("--long", m_long_flag, "Give the output in the long-format. This is the default.");
1919
// sub->add_flag("--porcelain[=<version>]", porcelain, "Give the output in an easy-to-parse format for scripts.
2020
// This is similar to the short output, but will remain stable across Git versions and regardless of user configuration.
2121
// See below for details. The version parameter is used to specify the format version. This is optional and defaults
2222
// to the original version v1 format.");
23-
sub->add_flag("-b,--branch", branch_flag, "Show the branch and tracking info even in short-format.");
23+
sub->add_flag("-b,--branch", m_branch_flag, "Show the branch and tracking info even in short-format.");
2424

2525
sub->callback([this]() { this->run(); });
2626
};
@@ -194,11 +194,11 @@ void status_subcommand::run()
194194
std::vector<std::string> ignored_to_print{};
195195

196196
output_format of = output_format::DEFAULT;
197-
if (short_flag)
197+
if (m_short_flag)
198198
{
199199
of = output_format::SHORT;
200200
}
201-
if (long_flag)
201+
if (m_long_flag)
202202
{
203203
of = output_format::LONG;
204204
}
@@ -215,7 +215,7 @@ void status_subcommand::run()
215215
}
216216
else
217217
{
218-
if (branch_flag)
218+
if (m_branch_flag)
219219
{
220220
std::cout << "## " << branch_name << std::endl;
221221
}

src/subcommand/status_subcommand.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class status_subcommand
1212
void run();
1313

1414
private:
15-
bool branch_flag = false;
16-
bool long_flag = false;
17-
bool short_flag = false;
15+
bool m_branch_flag = false;
16+
bool m_long_flag = false;
17+
bool m_short_flag = false;
1818
};

src/wrapper/index_wrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void index_wrapper::add_all()
2929

3030
void index_wrapper::add_impl(std::vector<std::string> patterns)
3131
{
32-
git_strarray_wrapper array=git_strarray_wrapper(patterns);
32+
git_strarray_wrapper array{patterns};
3333
throwIfError(git_index_add_all(*this, array, 0, NULL, NULL));
3434
throwIfError(git_index_write(*this));
3535
}

0 commit comments

Comments
 (0)