private static RemoteHandle RemoteFromNameOrUrl(RepositoryHandle repoHandle, string remote) { RemoteHandle handle = null; handle = Proxy.git_remote_lookup(repoHandle, remote, false); // If that wasn't the name of a remote, let's use it as a url if (handle == null) { handle = Proxy.git_remote_create_anonymous(repoHandle, remote); } return handle; }
public unsafe ObjectSafeWrapper(ObjectId id, RepositoryHandle handle, bool allowNullObjectId = false) { Ensure.ArgumentNotNull(handle, "handle"); if (allowNullObjectId && id == null) { objectPtr = new ObjectHandle(null, false); } else { Ensure.ArgumentNotNull(id, "id"); objectPtr = Proxy.git_object_lookup(handle, id, GitObjectType.Any); } }
static RemoteHandle BuildRemoteHandle(RepositoryHandle repoHandle, string url) { Debug.Assert(repoHandle != null && !repoHandle.IsNull); Debug.Assert(url != null); RemoteHandle remoteHandle = Proxy.git_remote_create_anonymous(repoHandle, url); Debug.Assert(remoteHandle != null && !(remoteHandle.IsNull)); return remoteHandle; }