/// <summary> /// Update/checkout changeset to working directory. /// </summary> /// <param name="repository"> /// The <see cref="Repository"/> to update. /// </param> /// <param name="command"> /// Any extra options to the tag method, or <c>null</c> for default options. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="repository"/> is <c>null</c>.</para> /// </exception> public static void UpdateGui(this Repository repository, UpdateGuiCommand command = null) { if (repository == null) throw new ArgumentNullException("repository"); command = command ?? new UpdateGuiCommand(); repository.Execute(command); }
/// <summary> /// Update/checkout changeset to working directory. /// </summary> /// <param name="repository"> /// The <see cref="Repository"/> to update. /// </param> /// <param name="revision"> /// The <see cref="RevSpec"/> of the revision to update to. /// </param> /// <param name="command"> /// Any extra options to the tag method, or <c>null</c> for default options. /// </param> /// <exception cref="ArgumentNullException"> /// <para><paramref name="repository"/> is <c>null</c>.</para> /// </exception> /// <exception cref="ArgumentException"> /// <para><see cref="UpdateGuiCommand.Revision"/> cannot be set before calling this method.</para> /// </exception> public static void UpdateGui(this Repository repository, RevSpec revision, UpdateGuiCommand command = null) { if (repository == null) throw new ArgumentNullException("repository"); if (revision == null) throw new ArgumentNullException("revision"); if (command != null && !StringEx.IsNullOrWhiteSpace(command.Revision)) throw new ArgumentException("UpdateGuiCommand.Revision cannot be set before calling this method", "command"); command = (command ?? new UpdateGuiCommand()) .WithRevision(revision); repository.Execute(command); }