[fragments] implement check if sparse checkout is active

GitOrigin-RevId: e7b68514ea6473a08794fbad51638bee9c3ca543
This commit is contained in:
Dmitry Zhuravlev
2024-06-07 15:48:07 +02:00
committed by intellij-monorepo-bot
parent 23af003173
commit 72f242e291

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package git4idea.config;
import com.intellij.openapi.project.Project;
@@ -75,6 +75,12 @@ public final class GitConfigUtil {
return getValue(h, key);
}
public static @Nullable String getValue(@NotNull Project project, @NotNull File root, @NotNull @NonNls String key)
throws VcsException {
GitLineHandler h = new GitLineHandler(project, root, GitCommand.CONFIG);
return getValue(h, key);
}
private static @Nullable String getValue(@NotNull GitLineHandler h, @NotNull @NonNls String key) throws VcsException {
h.setEnableInteractiveCallbacks(false);
h.setSilent(true);