本文整理汇总了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;
}
示例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");
}
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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"));
}
示例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);
}