Skip to content

Commit f4ec301

Browse files
committed
address review comments
1 parent 9874773 commit f4ec301

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

src/subcommand/status_subcommand.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
#include "status_subcommand.hpp"
88
#include "../wrapper/status_wrapper.hpp"
9-
#include "git2/diff.h"
109

1110
status_subcommand::status_subcommand(const libgit2_object&, CLI::App& app)
1211
{
@@ -27,15 +26,15 @@ status_subcommand::status_subcommand(const libgit2_object&, CLI::App& app)
2726
sub->callback([this]() { this->run(); });
2827
};
2928

30-
std::string untracked_header = "Untracked files:\n";
29+
const std::string untracked_header = "Untracked files:\n";
3130
// "Untracked files:\n (use \"git add <file>...\" to include in what will be committed)";
32-
std::string tobecommited_header = "Changes to be committed:\n";
31+
const std::string tobecommited_header = "Changes to be committed:\n";
3332
// "Changes to be committed:\n (use \"git reset HEAD <file>...\" to unstage)";
34-
std::string ignored_header = "Ignored files:\n";
33+
const std::string ignored_header = "Ignored files:\n";
3534
// "Ignored files:\n (use \"git add -f <file>...\" to include in what will be committed)"
36-
std::string notstagged_header = "Changes not staged for commit:\n";
35+
const std::string notstagged_header = "Changes not staged for commit:\n";
3736
// "Changes not staged for commit:\n (use \"git add%s <file>...\" to update what will be committed)\n (use \"git checkout -- <file>...\" to discard changes in working directory)"
38-
std::string nothingtocommit_message = "No changes added to commit";
37+
const std::string nothingtocommit_message = "No changes added to commit";
3938
// "No changes added to commit (use \"git add\" and/or \"git commit -a\")"
4039

4140
struct status_messages
@@ -53,7 +52,7 @@ const std::map<git_status_t, status_messages> status_msg_map = //TODO : check
5352
{ GIT_STATUS_INDEX_RENAMED, {"R ", "\t renamed:"} },
5453
{ GIT_STATUS_INDEX_TYPECHANGE, {"T ", "\t typechange:"} },
5554
{ GIT_STATUS_WT_NEW, {"?? ", ""} },
56-
{ GIT_STATUS_WT_MODIFIED, {" M" , "\t modified:"} },
55+
{ GIT_STATUS_WT_MODIFIED, {" M " , "\t modified:"} },
5756
{ GIT_STATUS_WT_DELETED, {" D ", "\t deleted:"} },
5857
{ GIT_STATUS_WT_TYPECHANGE, {" T ", "\t typechange:"} },
5958
{ GIT_STATUS_WT_RENAMED, {" R ", "\t renamed:"} },

src/utils/common.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
#include <string>
44
#include <utility>
55

6-
class noncopiable_nonmovable
6+
class noncopyable_nonmovable
77
{
88
public:
9-
noncopiable_nonmovable(const noncopiable_nonmovable&) = delete;
10-
noncopiable_nonmovable& operator=(const noncopiable_nonmovable&) = delete;
11-
noncopiable_nonmovable(noncopiable_nonmovable&&) = delete;
12-
noncopiable_nonmovable& operator=(noncopiable_nonmovable&&) = delete;
9+
noncopyable_nonmovable(const noncopyable_nonmovable&) = delete;
10+
noncopyable_nonmovable& operator=(const noncopyable_nonmovable&) = delete;
11+
noncopyable_nonmovable(noncopyable_nonmovable&&) = delete;
12+
noncopyable_nonmovable& operator=(noncopyable_nonmovable&&) = delete;
1313

1414
protected:
15-
noncopiable_nonmovable() = default;
16-
~noncopiable_nonmovable() = default;
15+
noncopyable_nonmovable() = default;
16+
~noncopyable_nonmovable() = default;
1717
};
1818

1919
template <class T>
2020
class wrapper_base
2121
{
2222
public:
23-
using ressource_type = T;
23+
using resource_type = T;
2424

2525
wrapper_base(const wrapper_base&) = delete;
2626
wrapper_base& operator=(const wrapper_base&) = delete;
@@ -36,7 +36,7 @@ class wrapper_base
3636
return this;
3737
}
3838

39-
operator ressource_type*() const noexcept
39+
operator resource_type*() const noexcept
4040
{
4141
return p_ressource;
4242
}
@@ -45,10 +45,10 @@ class wrapper_base
4545
// Allocation and deletion of p_ressource must be handled by inheriting class.
4646
wrapper_base() = default;
4747
~wrapper_base() = default;
48-
ressource_type* p_ressource = nullptr;
48+
resource_type* p_ressource = nullptr;
4949
};
5050

51-
class libgit2_object : private noncopiable_nonmovable
51+
class libgit2_object : private noncopyable_nonmovable
5252
{
5353
public:
5454

0 commit comments

Comments
 (0)