当前位置: 首页>>代码示例>>Java>>正文


Java GitConfigUtil.getValue方法代码示例

本文整理汇总了Java中git4idea.config.GitConfigUtil.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java GitConfigUtil.getValue方法的具体用法?Java GitConfigUtil.getValue怎么用?Java GitConfigUtil.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在git4idea.config.GitConfigUtil的用法示例。


在下文中一共展示了GitConfigUtil.getValue方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resolveUpdateMethod

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
@NotNull
public static UpdateMethod resolveUpdateMethod(@NotNull Project project, @NotNull VirtualFile root) {
  GitLocalBranch branch = GitBranchUtil.getCurrentBranch(project, root);
  boolean rebase = false;
  if (branch != null) {
    try {
      String rebaseValue = GitConfigUtil.getValue(project, root, "branch." + branch.getName() + ".rebase");
      rebase = rebaseValue != null && rebaseValue.equalsIgnoreCase("true");
    }
    catch (VcsException e) {
      LOG.warn("Couldn't get git config branch." + branch.getName() + ".rebase", e);
    }
  }
  return rebase ? UpdateMethod.REBASE : UpdateMethod.MERGE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:GitUpdater.java

示例2: updateTrackedBranch

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
/**
 * Update tracked branch basing on the currently selected branch
 */
private void updateTrackedBranch() {
  try {
    final VirtualFile root = gitRoot();
    String currentBranch = (String)myBranchComboBox.getSelectedItem();
    GitBranch trackedBranch = null;
    if (currentBranch != null) {
      String remote = GitConfigUtil.getValue(myProject, root, "branch." + currentBranch + ".remote");
      String mergeBranch = GitConfigUtil.getValue(myProject, root, "branch." + currentBranch + ".merge");
      if (remote == null || mergeBranch == null) {
        trackedBranch = null;
      }
      else {
        mergeBranch = GitBranchUtil.stripRefsPrefix(mergeBranch);
        if (remote.equals(".")) {
          trackedBranch = new GitSvnRemoteBranch(mergeBranch, GitBranch.DUMMY_HASH);
        }
        else {
          GitRemote r = GitBranchUtil.findRemoteByNameOrLogError(myProject, root, remote);
          if (r != null) {
            trackedBranch = new GitStandardRemoteBranch(r, mergeBranch, GitBranch.DUMMY_HASH);
          }
        }
      }
    }
    if (trackedBranch != null) {
      myOntoComboBox.setSelectedItem(trackedBranch);
    }
    else {
      GitUIUtil.getTextField(myOntoComboBox).setText("");
    }
    GitUIUtil.getTextField(myFromComboBox).setText("");
  }
  catch (VcsException e) {
    GitUIUtil.showOperationError(myProject, e, "git config");
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:GitRebaseDialog.java

示例3: getDefaultUpdaterForBranch

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
@NotNull
private static GitUpdater getDefaultUpdaterForBranch(@NotNull Project project, @NotNull Git git, @NotNull VirtualFile root,
                                                     @NotNull Map<VirtualFile, GitBranchPair> trackedBranches,
                                                     @NotNull ProgressIndicator progressIndicator, @NotNull UpdatedFiles updatedFiles) {
  try {
    final GitBranch branchName = GitBranchUtil.getCurrentBranch(project, root);
    final String rebase = GitConfigUtil.getValue(project, root, "branch." + branchName + ".rebase");
    if (rebase != null && rebase.equalsIgnoreCase("true")) {
      return new GitRebaseUpdater(project, git, root, trackedBranches, progressIndicator, updatedFiles);
    }
  } catch (VcsException e) {
    LOG.info("getDefaultUpdaterForBranch branch", e);
  }
  return new GitMergeUpdater(project, git, root, trackedBranches, progressIndicator, updatedFiles);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:GitUpdater.java

示例4: getUserNameAndEmailFromGitConfig

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
@NotNull
private Couple<String> getUserNameAndEmailFromGitConfig(@NotNull Project project, @NotNull VirtualFile root) throws VcsException {
  String name = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_NAME);
  String email = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_EMAIL);
  return Couple.of(name, email);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GitCheckinHandlerFactory.java

示例5: readCurrentUser

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
@Nullable
private VcsUser readCurrentUser(@NotNull Project project, @NotNull VirtualFile root) throws VcsException {
  String userName = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_NAME);
  String userEmail = StringUtil.notNullize(GitConfigUtil.getValue(project, root, GitConfigUtil.USER_EMAIL));
  return userName == null ? null : myFactory.createUser(userName, userEmail);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:GitUserRegistry.java

示例6: getTrackedRemoteName

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
/**
 * Get tracked remote for the branch
 */
@Nullable
public static String getTrackedRemoteName(Project project, VirtualFile root, String branchName) throws VcsException {
  return GitConfigUtil.getValue(project, root, trackedRemoteKey(branchName));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GitBranchUtil.java

示例7: getTrackedBranchName

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
/**
 * Get tracked branch of the given branch
 */
@Nullable
public static String getTrackedBranchName(Project project, VirtualFile root, String branchName) throws VcsException {
  return GitConfigUtil.getValue(project, root, trackedBranchKey(branchName));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GitBranchUtil.java

示例8: getMergeOrRebaseConfig

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
private static boolean getMergeOrRebaseConfig(Project project, VirtualFile root) throws VcsException {
  String autoSetupRebase = GitConfigUtil.getValue(project, root, GitConfigUtil.BRANCH_AUTOSETUP_REBASE);
  return autoSetupRebase != null && (autoSetupRebase.equals("remote") || autoSetupRebase.equals("always"));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:GitPusher.java

示例9: getUserNameAndEmailFromGitConfig

import git4idea.config.GitConfigUtil; //导入方法依赖的package包/类
@NotNull
private Pair<String, String> getUserNameAndEmailFromGitConfig(@NotNull Project project, @NotNull VirtualFile root) throws VcsException {
  String name = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_NAME);
  String email = GitConfigUtil.getValue(project, root, GitConfigUtil.USER_EMAIL);
  return Pair.create(name, email);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:GitCheckinHandlerFactory.java


注:本文中的git4idea.config.GitConfigUtil.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。