Re-integrate the GPG signed commit into the unit tests
[TortoiseGit.git] / src / TortoiseProc / GitDiff.h
blob6248951818be6e8cdb832316503243156da1bb69
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2008-2014, 2016-2017 - TortoiseGit
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include "TGitPath.h"
22 #include "GitRev.h"
23 #include "Git.h"
25 class CGitDiff
27 public:
28 CGitDiff() = delete;
30 // if you change something here, also update SubmoduleDiffDlg.cpp and SubmoduleResolveConflictDlg.cpp!
31 enum ChangeType
33 Unknown,
34 Identical,
35 NewSubmodule,
36 DeleteSubmodule,
37 FastForward,
38 Rewind,
39 NewerTime,
40 OlderTime,
41 SameTime
43 static void GetSubmoduleChangeType(CGit& subgit, const CGitHash& oldhash, const CGitHash& newhash, bool& oldOK, bool& newOK, ChangeType& changeType, CString& oldsub, CString& newsub);
45 // Use two path to handle rename cases
46 static int Diff(const CTGitPath* pPath1, const CTGitPath* pPath2, CString rev1, CString rev2, bool blame = false, bool unified = false, int jumpToLine = 0, bool bAlternativeTool = false, bool mustExist = true);
47 static int SubmoduleDiff(const CTGitPath* pPath1, const CTGitPath* pPath2, const CString& rev1, const CString& rev2, bool blame = false, bool unified = false);
48 static int DiffNull(const CTGitPath* pPath, CString rev1, bool bIsAdd = true, int jumpToLine = 0, bool bAlternative = false);
49 static int DiffCommit(const CTGitPath& path, const GitRev* r1, const GitRev* r2, bool bAlternative = false);
50 static int DiffCommit(const CTGitPath& path1, const CTGitPath& path2, const GitRev* r1, const GitRev* r2, bool bAlternative = false);
51 static int DiffCommit(const CTGitPath& path, const CString& r1, const CString& r2, bool bAlternative = false);
52 static int DiffCommit(const CTGitPath& path1, const CTGitPath& path2, const CString& r1, const CString& r2, bool bAlternative = false);
53 static int SubmoduleDiffNull(const CTGitPath* pPath1, const CString& rev1);