message: discard nothing should not lead to discard anything
diff: @@ -25,6 +25,7 @@ class TestFileContextMenu : public QObject {
  private slots:
  void testDiscardFile();
  void testDiscardFolder();
  + void testDiscardNothing();
  void testIgnoreFile();
  void testIgnoreFolder();
  };
  @@ -181,6 +182,74 @@ void TestFileContextMenu::testDiscardFolder() {
  }
  }
  +void TestFileContextMenu::testDiscardNothing() {
  + INIT_REPO("TestRepository.zip", false);
  +
  + git::Commit commit =
  + repo.lookupCommit("51198ba9b2b2b2c25ea6576cf7ca3e9f2a7c3fc7");
  + QVERIFY(commit);
  +
  + // modifying all files
  + QHash<QString, QString> fileContent{
  + {"file.txt", "Modified file"},
  + {"file2.txt", "Modified file2"},
  + {"folder1/file.txt", "Modified file in folder1"},
  + {"folder1/file2.txt", "Modified file2 in folder1"},
  + {"GittyupTestRepo/README.md", "Modified readme in submodule"},
  + };
  +
  + {
  + QHashIterator<QString, QString> i(fileContent);
  + while (i.hasNext()) {
  + i.next();
  + QFile file(repo.workdir().filePath(i.key()));
  + QVERIFY(file.exists());
  + QVERIFY(file.open(QFile::WriteOnly));
  + file.write(i.value().toLatin1());
  + }
  + }
  +
  + // refresh repo
  + repo.notifier()->referenceUpdated(repo.head());
  +
  + // let the changes settle
  + QApplication::processEvents();
  +
  + QStringList files; // no files passed
  + FileContextMenu m(repoView, files, repo.index());
  +
  + QAction *action = nullptr;
  + for (auto *a : m.actions()) {
  + if (a->text() == tr("Discard Changes")) {
  + action = a;
  + break;
  + }
  + }
  + QVERIFY(action);
  + action->triggered(true); // TODO: or hiding discard button?
  +
  + // original text
  + // {"file.txt", "File.txt\n"},
  + // {"file2.txt", "file2.txt\n"},
  + // {"folder1/file.txt", "file in folder1\n"},
  + // {"folder1/file2.txt", "file2 in folder1\n"},
  + // {"GittyupTestRepo/README.md",
  + // "# GittyupTestRepo\nTest repo for Gittyup used in the unittests\n"},
  +
  + {
  + // No file shall be discarded
  + QHash<QString, QString> fileContentRef = fileContent;
  + QHashIterator<QString, QString> i(fileContentRef);
  + while (i.hasNext()) {
  + i.next();
  + QFile file(repo.workdir().filePath(i.key()));
  + QVERIFY(file.exists());
  + QVERIFY(file.open(QFile::ReadOnly));
  + QVERIFY2(file.readAll() == i.value(), qPrintable(i.key()));
  + }
  + }
  +}
  +
  void TestFileContextMenu::testIgnoreFile() {
  INIT_REPO("TestRepository.zip", false);
  