public static void updateIndex(@NotNull Project project, @NotNull VirtualFile root, @NotNull FilePath filePath,
                                 @NotNull Hash blobHash,
                                 boolean isExecutable, boolean addNewFiles) throws VcsException {
    String mode = isExecutable ? EXECUTABLE_MODE : DEFAULT_MODE;
    String path = VcsFileUtil.relativePath(root, filePath);

    GitLineHandler h = new GitLineHandler(project, root, GitCommand.UPDATE_INDEX);
    if (addNewFiles) {
      h.addParameters("--add");
    }
    if (GitVersionSpecialty.CACHEINFO_SUPPORTS_SINGLE_PARAMETER_FORM.existsIn(project)) {
      h.addParameters("--cacheinfo", mode + "," + blobHash.asString() + "," + path);
    }
    else {
      h.addParameters("--cacheinfo", mode, blobHash.asString(), path);
    }
    h.endOptions();
    Git.getInstance().runCommandWithoutCollectingOutput(h).throwOnError();
  }
public static void updateIndex(@NotNull Project project, @NotNull VirtualFile root, @NotNull FilePath filePath,
                                 @NotNull Hash blobHash,
                                 boolean isExecutable, boolean addNewFiles)