mirror of
https://github.com/Murmele/Gittyup.git
synced 2024-09-11 10:45:39 +03:00
Merge pull request #713 from siforrer/fix-drop-pop-stash-crashes
Set head/stash reference after pop/drop stash
This commit is contained in:
commit
9c20e60e8d
@ -2122,6 +2122,13 @@ void RepoView::dropStash(int index) {
|
|||||||
LogEntry *entry = addLogEntry(msg(commit), tr("Drop Stash"));
|
LogEntry *entry = addLogEntry(msg(commit), tr("Drop Stash"));
|
||||||
if (!mRepo.dropStash(index))
|
if (!mRepo.dropStash(index))
|
||||||
error(entry, tr("drop stash"), commit.link());
|
error(entry, tr("drop stash"), commit.link());
|
||||||
|
|
||||||
|
if (mRepo.stashes().size() == 0) {
|
||||||
|
// switch back to head when there are no stashes left
|
||||||
|
mCommits->setReference(mRepo.head());
|
||||||
|
} else {
|
||||||
|
mCommits->setReference(mRepo.stashRef());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void RepoView::popStash(int index) {
|
void RepoView::popStash(int index) {
|
||||||
@ -2134,8 +2141,9 @@ void RepoView::popStash(int index) {
|
|||||||
error(entry, tr("pop stash"), commit.link());
|
error(entry, tr("pop stash"), commit.link());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// switch back to head
|
||||||
refresh(false);
|
selectReference(mRepo.head());
|
||||||
|
selectFirstCommit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RepoView::promptToAddTag(const git::Commit &commit) {
|
void RepoView::promptToAddTag(const git::Commit &commit) {
|
||||||
|
Loading…
Reference in New Issue
Block a user