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 
5 #include "cmConfigure.h" // IWYU pragma: keep
6 
7 #include <iosfwd>
8 #include <string>
9 
10 #include "cmCTestGlobalVC.h"
11 
12 class cmCTest;
13 
14 /** \class cmCTestGIT
15  * \brief Interaction with git command-line tool
16  *
17  */
18 class cmCTestGIT : public cmCTestGlobalVC
19 {
20 public:
21   /** Construct with a CTest instance and update log stream.  */
22   cmCTestGIT(cmCTest* ctest, std::ostream& log);
23 
24   ~cmCTestGIT() override;
25 
26 private:
27   unsigned int CurrentGitVersion;
28   unsigned int GetGitVersion();
29   std::string GetWorkingRevision();
30   bool NoteOldRevision() override;
31   bool NoteNewRevision() override;
32   bool UpdateImpl() override;
33 
34   std::string FindGitDir();
35   std::string FindTopDir();
36 
37   bool UpdateByFetchAndReset();
38   bool UpdateByCustom(std::string const& custom);
39   bool UpdateInternal();
40 
41   bool LoadRevisions() override;
42   bool LoadModifications() override;
43 
44   // "public" needed by older Sun compilers
45 public:
46   // Parsing helper classes.
47   class CommitParser;
48   class DiffParser;
49   class OneLineParser;
50 
51   friend class CommitParser;
52   friend class DiffParser;
53   friend class OneLineParser;
54 };
55