mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-10-06 06:57:09 +03:00
add possibility to force commiting so in the rebase test it can forced which is needed because during rebase operation we are on a detached head
This commit is contained in:
parent
9b3ad12be6
commit
c08dde3813
@ -971,14 +971,14 @@ public:
|
||||
layout->addLayout(buttonLayout);
|
||||
}
|
||||
|
||||
void commit() {
|
||||
void commit(bool force = false) {
|
||||
// Check for a merge head.
|
||||
git::AnnotatedCommit upstream;
|
||||
RepoView *view = RepoView::parentView(this);
|
||||
if (git::Reference mergeHead = view->repo().lookupRef("MERGE_HEAD")) // TODO: is it possible to use instead of the string GIT_MERGE_HEAD_FILE?
|
||||
upstream = mergeHead.annotatedCommit();
|
||||
|
||||
if (view->commit(mMessage->toPlainText(), upstream))
|
||||
if (view->commit(mMessage->toPlainText(), upstream, nullptr, force))
|
||||
mMessage->clear(); // Clear the message field.
|
||||
}
|
||||
|
||||
@ -1271,9 +1271,9 @@ DetailView::DetailView(const git::Repository &repo, QWidget *parent)
|
||||
|
||||
DetailView::~DetailView() {}
|
||||
|
||||
void DetailView::commit() {
|
||||
void DetailView::commit(bool force) {
|
||||
Q_ASSERT(isCommitEnabled());
|
||||
static_cast<CommitEditor *>(mDetail->currentWidget())->commit();
|
||||
static_cast<CommitEditor *>(mDetail->currentWidget())->commit(force);
|
||||
}
|
||||
|
||||
bool DetailView::isCommitEnabled() const {
|
||||
|
@ -49,7 +49,7 @@ public:
|
||||
virtual ~DetailView();
|
||||
|
||||
// commit
|
||||
void commit();
|
||||
void commit(bool force = false);
|
||||
bool isCommitEnabled() const;
|
||||
bool isRebaseContinueVisible() const;
|
||||
bool isRebaseAbortVisible() const;
|
||||
|
@ -475,7 +475,7 @@ void RepoView::selectHead() { mRefs->select(mRepo.head()); }
|
||||
|
||||
void RepoView::selectFirstCommit() { mCommits->selectFirstCommit(); }
|
||||
|
||||
void RepoView::commit() { mDetails->commit(); }
|
||||
void RepoView::commit(bool force) { mDetails->commit(force); }
|
||||
|
||||
bool RepoView::isCommitEnabled() const { return mDetails->isCommitEnabled(); }
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
bool lfsSetLocked(const QStringList &paths, bool locked);
|
||||
|
||||
// commit
|
||||
void commit();
|
||||
void commit(bool force = false);
|
||||
bool isCommitEnabled() const;
|
||||
|
||||
// stage / unstage
|
||||
|
@ -702,7 +702,8 @@ void TestRebase::commitDuringRebase() {
|
||||
|
||||
// Do commit before going on
|
||||
// So the user can commit between the rebase to split up the changes
|
||||
repoView->commit();
|
||||
bool force = true;
|
||||
repoView->commit(force);
|
||||
|
||||
refreshTriggered = 0;
|
||||
rebaseConflict = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user