Skip to content

Commit

Permalink
Prevent Uncommitted Changes from being shown when ShowCleanStatus is …
Browse files Browse the repository at this point in the history
…false

Previously, it was possible for the "Uncommitted Changes" row to be
appended to the CommitList even if "Show Clean Status" option had been
unchecked.  This commit prevents that from happening.
  • Loading branch information
jensenr30 committed Apr 20, 2024
1 parent 16d1e27 commit eac0673
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/ui/CommitList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ class CommitModel : public QAbstractListModel {

// Update status row.
bool head = (!mRef.isValid() || mRef.isHead());
bool valid = (mCleanStatus || !mStatus.isFinished() || status().isValid());
if (head && valid && mPathspec.isEmpty()) {
bool valid = (!mStatus.isFinished() || status().isValid());
if (mShowCleanStatus && head && valid && mPathspec.isEmpty()) {
QVector<Column> row;
if (mGraphVisible && mRef.isValid() && mStatus.isFinished()) {
row.append({Segment(Bottom, kTaintedColor), Segment(Dot, QColor())});
Expand Down Expand Up @@ -239,7 +239,7 @@ class CommitModel : public QAbstractListModel {
git::Config config = mRepo.appConfig();
mRefsAll = config.value<bool>("commit.refs.all", true);
mSortDate = config.value<bool>("commit.sort.date", true);
mCleanStatus = config.value<bool>("commit.status.clean", false);
mShowCleanStatus = config.value<bool>("commit.show.status", false);
mGraphVisible = config.value<bool>("commit.graph.visible", true);

if (walk)
Expand Down Expand Up @@ -559,7 +559,7 @@ class CommitModel : public QAbstractListModel {
bool mSuppressResetWalker{false};
bool mRefsAll = true;
bool mSortDate = true;
bool mCleanStatus = true;
bool mShowCleanStatus = true;
bool mGraphVisible = true;
};

Expand Down
2 changes: 1 addition & 1 deletion src/ui/CommitToolBar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace {
const QString kRefsKey = "commit.refs.all";
const QString kSortKey = "commit.sort.date";
const QString kGraphKey = "commit.graph.visible";
const QString kStatusKey = "commit.status.clean";
const QString kStatusKey = "commit.show.status";
const QString kStyleSheet = "QToolBar {"
" border: none"
"}"
Expand Down

0 comments on commit eac0673

Please sign in to comment.