/** * Whether the specified object is stored in this repo or any of the known * shared repositories. * * @param objectId * a {@link org.eclipse.jgit.lib.AnyObjectId} object. * @return true if the specified object is stored in this repo or any of the * known shared repositories. */ public boolean hasObject(AnyObjectId objectId) { try { return getObjectDatabase().has(objectId); } catch (IOException e) { // Legacy API, assume error means "no" return false; } }
/** * @param objectId * @return true if the specified object is stored in this repo or any of the * known shared repositories. */ public boolean hasObject(AnyObjectId objectId) { try { return getObjectDatabase().has(objectId); } catch (IOException e) { // Legacy API, assume error means "no" return false; } }
/** * Whether the specified object is stored in this repo or any of the known * shared repositories. * * @param objectId * a {@link org.eclipse.jgit.lib.AnyObjectId} object. * @return true if the specified object is stored in this repo or any of the * known shared repositories. */ public boolean hasObject(AnyObjectId objectId) { try { return getObjectDatabase().has(objectId); } catch (IOException e) { // Legacy API, assume error means "no" return false; } }
public List<ObjectId> execute() { final List<ObjectId> result = new ArrayList<>(); for (final String id : ids) { try { final Ref refName = git.getRef(id); if (refName != null) { result.add(refName.getObjectId()); continue; } try { final ObjectId _id = ObjectId.fromString(id); if (git.getRepository().getObjectDatabase().has(_id)) { result.add(_id); } } catch (final IllegalArgumentException ignored) { } } catch (final java.io.IOException ignored) { } } return result; } }
public static ObjectId resolveObjectId( final Git git, final String name ) { try { final Ref refName = getBranch( git, name ); if ( refName != null ) { return refName.getObjectId(); } try { final ObjectId id = ObjectId.fromString( name ); if ( git.getRepository().getObjectDatabase().has( id ) ) { return id; } } catch ( final IllegalArgumentException ex ) { } return null; } catch ( java.io.IOException e ) { } return null; }