Skip to content

Fix some spelling issues #923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub struct RepoBuilder<'cb> {

/// Type of callback passed to `RepoBuilder::remote_create`.
///
/// The second and third arguments are the remote's name and the remote's url.
/// The second and third arguments are the remote's name and the remote's URL.
pub type RemoteCreate<'cb> =
dyn for<'a> FnMut(&'a Repository, &str, &str) -> Result<Remote<'a>, Error> + 'cb;

Expand Down Expand Up @@ -89,7 +89,7 @@ pub struct CheckoutBuilder<'cb> {

/// Checkout progress notification callback.
///
/// The first argument is the path for the notification, the next is the numver
/// The first argument is the path for the notification, the next is the number
/// of completed steps so far, and the final is the total number of steps.
pub type Progress<'a> = dyn FnMut(Option<&Path>, usize, usize) + 'a;

Expand Down Expand Up @@ -121,10 +121,10 @@ pub enum CloneLocal {
/// Auto-detect (default)
///
/// Here libgit2 will bypass the git-aware transport for local paths, but
/// use a normal fetch for `file://` urls.
/// use a normal fetch for `file://` URLs.
Auto = raw::GIT_CLONE_LOCAL_AUTO as isize,

/// Bypass the git-aware transport even for `file://` urls.
/// Bypass the git-aware transport even for `file://` URLs.
Local = raw::GIT_CLONE_LOCAL as isize,

/// Never bypass the git-aware transport
Expand Down Expand Up @@ -230,7 +230,7 @@ impl<'cb> RepoBuilder<'cb> {

/// Clone a remote repository.
///
/// This will use the options configured so far to clone the specified url
/// This will use the options configured so far to clone the specified URL
/// into the specified local path.
pub fn clone(&mut self, url: &str, into: &Path) -> Result<Repository, Error> {
let mut opts: raw::git_clone_options = unsafe { mem::zeroed() };
Expand Down Expand Up @@ -354,7 +354,7 @@ impl<'cb> CheckoutBuilder<'cb> {
}

/// Indicate that the checkout should be performed safely, allowing new
/// files to be created but not overwriting extisting files or changes.
/// files to be created but not overwriting existing files or changes.
///
/// This is the default.
pub fn safe(&mut self) -> &mut CheckoutBuilder<'cb> {
Expand Down
10 changes: 5 additions & 5 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl Config {
/// exists. The returned path may be used on any method call to load
/// the global configuration file.
///
/// This method will not guess the path to the xdg compatible config file
/// This method will not guess the path to the XDG compatible config file
/// (`.config/git/config`).
pub fn find_global() -> Result<PathBuf, Error> {
crate::init();
Expand All @@ -121,7 +121,7 @@ impl Config {

/// Locate the path to the system configuration file
///
/// If /etc/gitconfig doesn't exist, it will look for %PROGRAMFILES%
/// If /etc/gitconfig doesn't exist, it will look for `%PROGRAMFILES%`
pub fn find_system() -> Result<PathBuf, Error> {
crate::init();
let buf = Buf::new();
Expand All @@ -131,9 +131,9 @@ impl Config {
Ok(util::bytes2path(&buf).to_path_buf())
}

/// Locate the path to the global xdg compatible configuration file
/// Locate the path to the global XDG compatible configuration file
///
/// The xdg compatible configuration file is usually located in
/// The XDG compatible configuration file is usually located in
/// `$HOME/.config/git/config`.
pub fn find_xdg() -> Result<PathBuf, Error> {
crate::init();
Expand Down Expand Up @@ -369,7 +369,7 @@ impl Config {
/// Open the global/XDG configuration file according to git's rules
///
/// Git allows you to store your global configuration at `$HOME/.config` or
/// `$XDG_CONFIG_HOME/git/config`. For backwards compatability, the XDG file
/// `$XDG_CONFIG_HOME/git/config`. For backwards compatibility, the XDG file
/// shouldn't be used unless the use has created it explicitly. With this
/// function you'll open the correct one to write to.
pub fn open_global(&mut self) -> Result<Config, Error> {
Expand Down
8 changes: 4 additions & 4 deletions src/cred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl Cred {
///
/// This function will attempt to parse the user's `credential.helper`
/// configuration, invoke the necessary processes, and read off what the
/// username/password should be for a particular url.
/// username/password should be for a particular URL.
///
/// The returned credential type will be a username/password credential if
/// successful.
Expand All @@ -140,7 +140,7 @@ impl Cred {
/// Create a credential to specify a username.
///
/// This is used with ssh authentication to query for the username if none is
/// specified in the url.
/// specified in the URL.
pub fn username(username: &str) -> Result<Cred, Error> {
crate::init();
let username = CString::new(username)?;
Expand Down Expand Up @@ -194,8 +194,8 @@ impl CredentialHelper {
/// Create a new credential helper object which will be used to probe git's
/// local credential configuration.
///
/// The url specified is the namespace on which this will query credentials.
/// Invalid urls are currently ignored.
/// The URL specified is the namespace on which this will query credentials.
/// Invalid URLs are currently ignored.
pub fn new(url: &str) -> CredentialHelper {
let mut ret = CredentialHelper {
protocol: None,
Expand Down
4 changes: 2 additions & 2 deletions src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ impl<'repo> Diff<'repo> {
Ok(buf)
}

/// Create an patchid from a diff.
/// Create an patch ID from a diff.
pub fn patchid(&self, opts: Option<&mut DiffPatchidOptions>) -> Result<Oid, Error> {
let mut raw = raw::git_oid {
id: [0; raw::GIT_OID_RAWSZ],
Expand All @@ -310,7 +310,7 @@ impl Diff<'static> {
/// produced if you actually produced it computationally by comparing
/// two trees, however there may be subtle differences. For example,
/// a patch file likely contains abbreviated object IDs, so the
/// object IDs parsed by this function will also be abreviated.
/// object IDs parsed by this function will also be abbreviated.
pub fn from_buffer(buffer: &[u8]) -> Result<Diff<'static>, Error> {
crate::init();
let mut diff: *mut raw::git_diff = std::ptr::null_mut();
Expand Down
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Error {
impl Error {
/// Creates a new error.
///
/// This is mainly intended for implementors of custom transports or
/// This is mainly intended for implementers of custom transports or
/// database backends, where it is desirable to propagate an [`Error`]
/// through `libgit2`.
pub fn new<S: AsRef<str>>(code: ErrorCode, class: ErrorClass, message: S) -> Self {
Expand Down Expand Up @@ -134,7 +134,7 @@ impl Error {

/// Modify the error code associated with this error.
///
/// This is mainly intended to be used by implementors of custom transports
/// This is mainly intended to be used by implementers of custom transports
/// or database backends, and should be used with care.
pub fn set_code(&mut self, code: ErrorCode) {
self.code = match code {
Expand Down Expand Up @@ -216,7 +216,7 @@ impl Error {

/// Modify the error class associated with this error.
///
/// This is mainly intended to be used by implementors of custom transports
/// This is mainly intended to be used by implementers of custom transports
/// or database backends, and should be used with care.
pub fn set_class(&mut self, class: ErrorClass) {
self.klass = match class {
Expand Down
2 changes: 1 addition & 1 deletion src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub struct IndexConflict {
/// A callback function to filter index matches.
///
/// Used by `Index::{add_all,remove_all,update_all}`. The first argument is the
/// path, and the second is the patchspec that matched it. Return 0 to confirm
/// path, and the second is the pathspec that matched it. Return 0 to confirm
/// the operation on the item, > 0 to skip the item, and < 0 to abort the scan.
pub type IndexMatchedPath<'a> = dyn FnMut(&Path, &[u8]) -> i32 + 'a;

Expand Down
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ pub enum ErrorClass {
Object,
/// Network error
Net,
/// Error manpulating a tag
/// Error manipulating a tag
Tag,
/// Invalid value in tree
Tree,
/// Hashing or packing error
Indexer,
/// Error from SSL
Ssl,
/// Error involing submodules
/// Error involving submodules
Submodule,
/// Threading error
Thread,
Expand Down Expand Up @@ -349,7 +349,7 @@ pub enum ObjectType {
Tag,
}

/// An enumeration of all possile kinds of references.
/// An enumeration of all possible kinds of references.
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
pub enum ReferenceType {
/// A reference which points at an object id.
Expand Down Expand Up @@ -1172,7 +1172,7 @@ bitflags! {
///
/// Lastly, the following will only be returned for ignore "NONE".
///
/// * WD_UNTRACKED - wd contains untracked files
/// * WD_UNTRACKED - workdir contains untracked files
pub struct SubmoduleStatus: u32 {
#[allow(missing_docs)]
const IN_HEAD = raw::GIT_SUBMODULE_STATUS_IN_HEAD as u32;
Expand Down Expand Up @@ -1273,7 +1273,7 @@ bitflags! {
/// Use the default pathspec matching configuration.
const DEFAULT = raw::GIT_PATHSPEC_DEFAULT as u32;
/// Force matching to ignore case, otherwise matching will use native
/// case sensitivity fo the platform filesystem.
/// case sensitivity of the platform filesystem.
const IGNORE_CASE = raw::GIT_PATHSPEC_IGNORE_CASE as u32;
/// Force case sensitive matches, otherwise match will use the native
/// case sensitivity of the platform filesystem.
Expand Down Expand Up @@ -1521,7 +1521,7 @@ bitflags! {
pub struct ReferenceFormat: u32 {
/// No particular normalization.
const NORMAL = raw::GIT_REFERENCE_FORMAT_NORMAL as u32;
/// Constrol whether one-level refname are accepted (i.e., refnames that
/// Control whether one-level refname are accepted (i.e., refnames that
/// do not contain multiple `/`-separated components). Those are
/// expected to be written only using uppercase letters and underscore
/// (e.g. `HEAD`, `FETCH_HEAD`).
Expand Down
4 changes: 2 additions & 2 deletions src/odb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl<'repo> Odb<'repo> {
/// deletion of the mempack backend.
///
/// Here is an example that fails to compile because it tries to hold the
/// mempack reference beyond the odb's lifetime:
/// mempack reference beyond the Odb's lifetime:
///
/// ```compile_fail
/// use git2::Odb;
Expand Down Expand Up @@ -388,7 +388,7 @@ impl<'repo> OdbWriter<'repo> {
/// This method can be used to finalize writing object to the database and get an identifier.
/// The object will take its final name and will be available to the odb.
/// This method will fail if the total number of received bytes differs from the size declared with odb_writer()
/// Attepting write after finishing will be ignored.
/// Attempting write after finishing will be ignored.
pub fn finalize(&mut self) -> Result<Oid, Error> {
let mut raw = raw::git_oid {
id: [0; raw::GIT_OID_RAWSZ],
Expand Down
2 changes: 1 addition & 1 deletion src/oid_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::slice;

/// An oid array structure used by libgit2
///
/// Some apis return arrays of oids which originate from libgit2. This
/// Some APIs return arrays of OIDs which originate from libgit2. This
/// wrapper type behaves a little like `Vec<&Oid>` but does so without copying
/// the underlying Oids until necessary.
pub struct OidArray {
Expand Down
2 changes: 1 addition & 1 deletion src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ where
Ok(())
}

/// Set wheter or not to verify ownership before performing a repository.
/// Set whether or not to verify ownership before performing a repository.
/// Enabled by default, but disabling this can lead to code execution vulnerabilities.
pub unsafe fn set_verify_owner_validation(enabled: bool) -> Result<(), Error> {
crate::init();
Expand Down
10 changes: 5 additions & 5 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl<'repo> Remote<'repo> {

/// Create a detached remote
///
/// Create a remote with the given url in-memory. You can use this
/// Create a remote with the given URL in-memory. You can use this
/// when you have a URL instead of a remote's name.
/// Contrasted with an anonymous remote, a detached remote will not
/// consider any repo configuration values.
Expand Down Expand Up @@ -126,14 +126,14 @@ impl<'repo> Remote<'repo> {
unsafe { crate::opt_bytes(self, raw::git_remote_name(&*self.raw)) }
}

/// Get the remote's url.
/// Get the remote's URL.
///
/// Returns `None` if the url is not valid utf-8
/// Returns `None` if the URL is not valid utf-8
pub fn url(&self) -> Option<&str> {
str::from_utf8(self.url_bytes()).ok()
}

/// Get the remote's url as a byte array.
/// Get the remote's URL as a byte array.
pub fn url_bytes(&self) -> &[u8] {
unsafe { crate::opt_bytes(self, raw::git_remote_url(&*self.raw)).unwrap() }
}
Expand Down Expand Up @@ -246,7 +246,7 @@ impl<'repo> Remote<'repo> {
/// Cancel the operation
///
/// At certain points in its operation, the network code checks whether the
/// operation has been cancelled and if so stops the operation.
/// operation has been canceled and if so stops the operation.
pub fn stop(&mut self) -> Result<(), Error> {
unsafe {
try_call!(raw::git_remote_stop(self.raw));
Expand Down
6 changes: 3 additions & 3 deletions src/remote_callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub struct RemoteCallbacks<'a> {
/// Callback used to acquire credentials for when a remote is fetched.
///
/// * `url` - the resource for which the credentials are required.
/// * `username_from_url` - the username that was embedded in the url, or `None`
/// * `username_from_url` - the username that was embedded in the URL, or `None`
/// if it was not included.
/// * `allowed_types` - a bitmask stating which cred types are ok to return.
/// * `allowed_types` - a bitmask stating which cred types are OK to return.
pub type Credentials<'a> =
dyn FnMut(&str, Option<&str>, CredentialType) -> Result<Cred, Error> + 'a;

Expand All @@ -46,7 +46,7 @@ pub type UpdateTips<'a> = dyn FnMut(&str, Oid, Oid) -> bool + 'a;

/// Callback for a custom certificate check.
///
/// The first argument is the certificate receved on the connection.
/// The first argument is the certificate received on the connection.
/// Certificates are typically either an SSH or X509 certificate.
///
/// The second argument is the hostname for the connection is passed as the last
Expand Down
12 changes: 6 additions & 6 deletions src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ impl Repository {

/// Create an anonymous remote
///
/// Create a remote with the given url and refspec in memory. You can use
/// Create a remote with the given URL and refspec in memory. You can use
/// this when you have a URL instead of a remote's name. Note that anonymous
/// remotes cannot be converted to persisted remotes.
pub fn remote_anonymous(&self, url: &str) -> Result<Remote<'_>, Error> {
Expand Down Expand Up @@ -707,7 +707,7 @@ impl Repository {
Ok(())
}

/// Set the remote's url in the configuration
/// Set the remote's URL in the configuration
///
/// Remote objects already in memory will not be affected. This assumes
/// the common case of a single-url remote and will otherwise return an
Expand All @@ -721,7 +721,7 @@ impl Repository {
Ok(())
}

/// Set the remote's url for pushing in the configuration.
/// Set the remote's URL for pushing in the configuration.
///
/// Remote objects already in memory will not be affected. This assumes
/// the common case of a single-url remote and will otherwise return an
Expand Down Expand Up @@ -1211,7 +1211,7 @@ impl Repository {
///
/// This behaves like `Repository::branch()` but takes
/// an annotated commit, which lets you specify which
/// extended sha syntax string was specified by a user,
/// extended SHA syntax string was specified by a user,
/// allowing for more exact reflog messages.
///
/// See the documentation for `Repository::branch()`
Expand Down Expand Up @@ -3154,7 +3154,7 @@ impl Repository {
/// `callback` will be called with with following arguments:
///
/// - `&str`: the reference name
/// - `&[u8]`: the remote url
/// - `&[u8]`: the remote URL
/// - `&Oid`: the reference target OID
/// - `bool`: was the reference the result of a merge
pub fn fetchhead_foreach<C>(&self, mut callback: C) -> Result<(), Error>
Expand Down Expand Up @@ -3283,7 +3283,7 @@ impl RepositoryInitOptions {

/// The path to the working directory.
///
/// If this is a relative path it will be evaulated relative to the repo
/// If this is a relative path it will be evaluated relative to the repo
/// path. If this is not the "natural" working directory, a .git gitlink
/// file will be created here linking to the repo path.
pub fn workdir_path(&mut self, path: &Path) -> &mut RepositoryInitOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/revwalk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub struct Revwalk<'repo> {
_marker: marker::PhantomData<&'repo Repository>,
}

/// A `Revwalk` with an assiciated "hide callback", see `with_hide_callback`
/// A `Revwalk` with an associated "hide callback", see `with_hide_callback`
pub struct RevwalkWithHideCb<'repo, 'cb, C>
where
C: FnMut(Oid) -> bool,
Expand Down
2 changes: 1 addition & 1 deletion src/string_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::util::Binding;

/// A string array structure used by libgit2
///
/// Some apis return arrays of strings which originate from libgit2. This
/// Some APIs return arrays of strings which originate from libgit2. This
/// wrapper type behaves a little like `Vec<&str>` but does so without copying
/// the underlying strings until necessary.
pub struct StringArray {
Expand Down
Loading