You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check git version before attempting to disable sparse-checkout (#1656)
* Check git version before attempting to disable `sparse-checkout`
* Bump `MinimumGitSparseCheckoutVersion` to 2.28 due to #1386
* Initial prep for release 4.1.3
gitVersion = new git_version_1.GitVersion(match[0]);
918
+
this.gitVersion = new git_version_1.GitVersion(match[0]);
911
919
}
912
920
}
913
-
if (!gitVersion.isValid()) {
921
+
if (!this.gitVersion.isValid()) {
914
922
throw new Error('Unable to determine git version');
915
923
}
916
924
// Minimum git version
917
-
if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
918
-
throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
925
+
if (!this.gitVersion.checkMinimum(exports.MinimumGitVersion)) {
926
+
throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
919
927
}
920
928
if (this.lfs) {
921
929
// Git-lfs version
@@ -943,14 +951,12 @@ class GitCommandManager {
943
951
}
944
952
this.doSparseCheckout = doSparseCheckout;
945
953
if (this.doSparseCheckout) {
946
-
// The `git sparse-checkout` command was introduced in Git v2.25.0
947
-
const minimumGitSparseCheckoutVersion = new git_version_1.GitVersion('2.25');
948
-
if (!gitVersion.checkMinimum(minimumGitSparseCheckoutVersion)) {
949
-
throw new Error(`Minimum Git version required for sparse checkout is ${minimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
954
+
if (!this.gitVersion.checkMinimum(exports.MinimumGitSparseCheckoutVersion)) {
955
+
throw new Error(`Minimum Git version required for sparse checkout is ${exports.MinimumGitSparseCheckoutVersion}. Your git ('${this.gitPath}') is ${this.gitVersion}`);
0 commit comments