cmCTestGIT.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #pragma once
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <iosfwd>
  6. #include <string>
  7. #include "cmCTestGlobalVC.h"
  8. class cmCTest;
  9. /** \class cmCTestGIT
  10. * \brief Interaction with git command-line tool
  11. *
  12. */
  13. class cmCTestGIT : public cmCTestGlobalVC
  14. {
  15. public:
  16. /** Construct with a CTest instance and update log stream. */
  17. cmCTestGIT(cmCTest* ctest, std::ostream& log);
  18. ~cmCTestGIT() override;
  19. private:
  20. unsigned int CurrentGitVersion;
  21. unsigned int GetGitVersion();
  22. std::string GetWorkingRevision();
  23. bool NoteOldRevision() override;
  24. bool NoteNewRevision() override;
  25. bool UpdateImpl() override;
  26. std::string FindGitDir();
  27. std::string FindTopDir();
  28. bool UpdateByFetchAndReset();
  29. bool UpdateByCustom(std::string const& custom);
  30. bool UpdateInternal();
  31. bool LoadRevisions() override;
  32. bool LoadModifications() override;
  33. // "public" needed by older Sun compilers
  34. public:
  35. // Parsing helper classes.
  36. class CommitParser;
  37. class DiffParser;
  38. class OneLineParser;
  39. friend class CommitParser;
  40. friend class DiffParser;
  41. friend class OneLineParser;
  42. };