本文整理匯總了Java中org.eclipse.jgit.lib.Ref.isSymbolic方法的典型用法代碼示例。如果您正苦於以下問題:Java Ref.isSymbolic方法的具體用法?Java Ref.isSymbolic怎麽用?Java Ref.isSymbolic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jgit.lib.Ref
的用法示例。
在下文中一共展示了Ref.isSymbolic方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getDefaultBranch
import org.eclipse.jgit.lib.Ref; //導入方法依賴的package包/類
@Nullable
public String getDefaultBranch() {
if (defaultBranchOptional == null) {
try {
Ref headRef = getRepository().findRef("HEAD");
if (headRef != null
&& headRef.isSymbolic()
&& headRef.getTarget().getName().startsWith(Constants.R_HEADS)
&& headRef.getObjectId() != null) {
defaultBranchOptional = Optional.of(Repository.shortenRefName(headRef.getTarget().getName()));
} else {
defaultBranchOptional = Optional.absent();
}
} catch (IOException e) {
throw new RuntimeException(e);
}
}
return defaultBranchOptional.orNull();
}
示例2: canMerge
import org.eclipse.jgit.lib.Ref; //導入方法依賴的package包/類
private boolean canMerge(final Repository repository) {
String message = null;
Exception ex = null;
try {
Ref head = repository.getRef(Constants.HEAD);
if (head == null || !head.isSymbolic())
message = UIText.MergeAction_HeadIsNoBranch;
else if (!repository.getRepositoryState().equals(
RepositoryState.SAFE))
message = NLS.bind(UIText.MergeAction_WrongRepositoryState,
repository.getRepositoryState());
else if (!head.getLeaf().getName().startsWith("refs/heads/features")) { //$NON-NLS-1$
message = "Current branch is not a feature branch.";
}
} catch (IOException e) {
message = e.getMessage();
ex = e;
}
if (message != null)
org.eclipse.egit.ui.Activator.handleError(message, ex, true);
return (message == null);
}
示例3: scanAllRefs
import org.eclipse.jgit.lib.Ref; //導入方法依賴的package包/類
/**
* Read all known references in the repository.
*
* @return all current references of the repository.
* @throws IOException references cannot be accessed.
*/
@Override
protected RefCache scanAllRefs() throws IOException {
RefList.Builder<Ref> ids = new RefList.Builder<Ref>();
RefList.Builder<Ref> sym = new RefList.Builder<Ref>();
for (Ref ref : refs.values()) {
if (ref.isSymbolic()) {
sym.add(ref);
}
ids.add(ref);
}
ids.sort();
sym.sort();
return new RefCache(ids.toRefList(), sym.toRefList());
}
示例4: matches
import org.eclipse.jgit.lib.Ref; //導入方法依賴的package包/類
@Override
boolean matches(Repository git) throws IOException {
Ref head = git.getRefDatabase().exactRef(Constants.HEAD);
return head != null
&& head.isSymbolic()
&& RefNames.REFS_CONFIG.equals(head.getLeaf().getName());
}
示例5: skip
import org.eclipse.jgit.lib.Ref; //導入方法依賴的package包/類
static boolean skip(Ref ref) {
return ref.isSymbolic() || ref.getObjectId() == null || PatchSet.isChangeRef(ref.getName());
}