[fix]:修正hybridclr与il2cpp_plus仓库更新检测的fetch深度 (#15)

[fix]:修正hybridclr与il2cpp_plus仓库更新检测的fetch深度
main
ForeseePretty 2022-10-28 13:52:32 +08:00 committed by GitHub
parent 77b7dea7bc
commit bf8e5c4840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -6,10 +6,12 @@
{ {
string workDir = SettingsUtil.HybridCLRDataDir; string workDir = SettingsUtil.HybridCLRDataDir;
// last hash hybridclr // last hash hybridclr
string hybridclrRepoDir = $"{workDir}/{hybridclr_repo_path}";
{ {
string hybridclrRepoDir = $"{workDir}/{hybridclr_repo_path}";
var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git", var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", });
BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "fetch", "depth=1" });
var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git", var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", });
if (ret1.StdOut != ret2.StdOut) if (ret1.StdOut != ret2.StdOut)
@ -17,12 +19,13 @@
return true; return true;
} }
} }
// last hash il2cpp_plus // last hash il2cpp_plus
string il2cppPlusRepoDir = $"{workDir}/{il2cpp_plus_repo_path}";
{ {
string il2cppPlusRepoDir = $"{workDir}/{il2cpp_plus_repo_path}";
var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "fetch", "depth=1" });
var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
if (ret1.StdOut != ret2.StdOut) if (ret1.StdOut != ret2.StdOut)