Skip to content

Commit c5765ef

Browse files
authored
Merge pull request #923 from ehuss/spelling
Fix some spelling issues
2 parents 49ff3eb + 17cd326 commit c5765ef

22 files changed

+64
-64
lines changed

src/build.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub struct RepoBuilder<'cb> {
6060

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

@@ -89,7 +89,7 @@ pub struct CheckoutBuilder<'cb> {
8989

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

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

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

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

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

356356
/// Indicate that the checkout should be performed safely, allowing new
357-
/// files to be created but not overwriting extisting files or changes.
357+
/// files to be created but not overwriting existing files or changes.
358358
///
359359
/// This is the default.
360360
pub fn safe(&mut self) -> &mut CheckoutBuilder<'cb> {

src/config.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl Config {
108108
/// exists. The returned path may be used on any method call to load
109109
/// the global configuration file.
110110
///
111-
/// This method will not guess the path to the xdg compatible config file
111+
/// This method will not guess the path to the XDG compatible config file
112112
/// (`.config/git/config`).
113113
pub fn find_global() -> Result<PathBuf, Error> {
114114
crate::init();
@@ -121,7 +121,7 @@ impl Config {
121121

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

134-
/// Locate the path to the global xdg compatible configuration file
134+
/// Locate the path to the global XDG compatible configuration file
135135
///
136-
/// The xdg compatible configuration file is usually located in
136+
/// The XDG compatible configuration file is usually located in
137137
/// `$HOME/.config/git/config`.
138138
pub fn find_xdg() -> Result<PathBuf, Error> {
139139
crate::init();
@@ -369,7 +369,7 @@ impl Config {
369369
/// Open the global/XDG configuration file according to git's rules
370370
///
371371
/// Git allows you to store your global configuration at `$HOME/.config` or
372-
/// `$XDG_CONFIG_HOME/git/config`. For backwards compatability, the XDG file
372+
/// `$XDG_CONFIG_HOME/git/config`. For backwards compatibility, the XDG file
373373
/// shouldn't be used unless the use has created it explicitly. With this
374374
/// function you'll open the correct one to write to.
375375
pub fn open_global(&mut self) -> Result<Config, Error> {

src/cred.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Cred {
113113
///
114114
/// This function will attempt to parse the user's `credential.helper`
115115
/// configuration, invoke the necessary processes, and read off what the
116-
/// username/password should be for a particular url.
116+
/// username/password should be for a particular URL.
117117
///
118118
/// The returned credential type will be a username/password credential if
119119
/// successful.
@@ -140,7 +140,7 @@ impl Cred {
140140
/// Create a credential to specify a username.
141141
///
142142
/// This is used with ssh authentication to query for the username if none is
143-
/// specified in the url.
143+
/// specified in the URL.
144144
pub fn username(username: &str) -> Result<Cred, Error> {
145145
crate::init();
146146
let username = CString::new(username)?;
@@ -194,8 +194,8 @@ impl CredentialHelper {
194194
/// Create a new credential helper object which will be used to probe git's
195195
/// local credential configuration.
196196
///
197-
/// The url specified is the namespace on which this will query credentials.
198-
/// Invalid urls are currently ignored.
197+
/// The URL specified is the namespace on which this will query credentials.
198+
/// Invalid URLs are currently ignored.
199199
pub fn new(url: &str) -> CredentialHelper {
200200
let mut ret = CredentialHelper {
201201
protocol: None,

src/diff.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'repo> Diff<'repo> {
286286
Ok(buf)
287287
}
288288

289-
/// Create an patchid from a diff.
289+
/// Create an patch ID from a diff.
290290
pub fn patchid(&self, opts: Option<&mut DiffPatchidOptions>) -> Result<Oid, Error> {
291291
let mut raw = raw::git_oid {
292292
id: [0; raw::GIT_OID_RAWSZ],
@@ -310,7 +310,7 @@ impl Diff<'static> {
310310
/// produced if you actually produced it computationally by comparing
311311
/// two trees, however there may be subtle differences. For example,
312312
/// a patch file likely contains abbreviated object IDs, so the
313-
/// object IDs parsed by this function will also be abreviated.
313+
/// object IDs parsed by this function will also be abbreviated.
314314
pub fn from_buffer(buffer: &[u8]) -> Result<Diff<'static>, Error> {
315315
crate::init();
316316
let mut diff: *mut raw::git_diff = std::ptr::null_mut();

src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct Error {
1818
impl Error {
1919
/// Creates a new error.
2020
///
21-
/// This is mainly intended for implementors of custom transports or
21+
/// This is mainly intended for implementers of custom transports or
2222
/// database backends, where it is desirable to propagate an [`Error`]
2323
/// through `libgit2`.
2424
pub fn new<S: AsRef<str>>(code: ErrorCode, class: ErrorClass, message: S) -> Self {
@@ -134,7 +134,7 @@ impl Error {
134134

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

217217
/// Modify the error class associated with this error.
218218
///
219-
/// This is mainly intended to be used by implementors of custom transports
219+
/// This is mainly intended to be used by implementers of custom transports
220220
/// or database backends, and should be used with care.
221221
pub fn set_class(&mut self, class: ErrorClass) {
222222
self.klass = match class {

src/index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub struct IndexConflict {
4545
/// A callback function to filter index matches.
4646
///
4747
/// Used by `Index::{add_all,remove_all,update_all}`. The first argument is the
48-
/// path, and the second is the patchspec that matched it. Return 0 to confirm
48+
/// path, and the second is the pathspec that matched it. Return 0 to confirm
4949
/// the operation on the item, > 0 to skip the item, and < 0 to abort the scan.
5050
pub type IndexMatchedPath<'a> = dyn FnMut(&Path, &[u8]) -> i32 + 'a;
5151

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,15 @@ pub enum ErrorClass {
249249
Object,
250250
/// Network error
251251
Net,
252-
/// Error manpulating a tag
252+
/// Error manipulating a tag
253253
Tag,
254254
/// Invalid value in tree
255255
Tree,
256256
/// Hashing or packing error
257257
Indexer,
258258
/// Error from SSL
259259
Ssl,
260-
/// Error involing submodules
260+
/// Error involving submodules
261261
Submodule,
262262
/// Threading error
263263
Thread,
@@ -349,7 +349,7 @@ pub enum ObjectType {
349349
Tag,
350350
}
351351

352-
/// An enumeration of all possile kinds of references.
352+
/// An enumeration of all possible kinds of references.
353353
#[derive(PartialEq, Eq, Copy, Clone, Debug)]
354354
pub enum ReferenceType {
355355
/// A reference which points at an object id.
@@ -1172,7 +1172,7 @@ bitflags! {
11721172
///
11731173
/// Lastly, the following will only be returned for ignore "NONE".
11741174
///
1175-
/// * WD_UNTRACKED - wd contains untracked files
1175+
/// * WD_UNTRACKED - workdir contains untracked files
11761176
pub struct SubmoduleStatus: u32 {
11771177
#[allow(missing_docs)]
11781178
const IN_HEAD = raw::GIT_SUBMODULE_STATUS_IN_HEAD as u32;
@@ -1273,7 +1273,7 @@ bitflags! {
12731273
/// Use the default pathspec matching configuration.
12741274
const DEFAULT = raw::GIT_PATHSPEC_DEFAULT as u32;
12751275
/// Force matching to ignore case, otherwise matching will use native
1276-
/// case sensitivity fo the platform filesystem.
1276+
/// case sensitivity of the platform filesystem.
12771277
const IGNORE_CASE = raw::GIT_PATHSPEC_IGNORE_CASE as u32;
12781278
/// Force case sensitive matches, otherwise match will use the native
12791279
/// case sensitivity of the platform filesystem.
@@ -1521,7 +1521,7 @@ bitflags! {
15211521
pub struct ReferenceFormat: u32 {
15221522
/// No particular normalization.
15231523
const NORMAL = raw::GIT_REFERENCE_FORMAT_NORMAL as u32;
1524-
/// Constrol whether one-level refname are accepted (i.e., refnames that
1524+
/// Control whether one-level refname are accepted (i.e., refnames that
15251525
/// do not contain multiple `/`-separated components). Those are
15261526
/// expected to be written only using uppercase letters and underscore
15271527
/// (e.g. `HEAD`, `FETCH_HEAD`).

src/odb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl<'repo> Odb<'repo> {
240240
/// deletion of the mempack backend.
241241
///
242242
/// Here is an example that fails to compile because it tries to hold the
243-
/// mempack reference beyond the odb's lifetime:
243+
/// mempack reference beyond the Odb's lifetime:
244244
///
245245
/// ```compile_fail
246246
/// use git2::Odb;
@@ -388,7 +388,7 @@ impl<'repo> OdbWriter<'repo> {
388388
/// This method can be used to finalize writing object to the database and get an identifier.
389389
/// The object will take its final name and will be available to the odb.
390390
/// This method will fail if the total number of received bytes differs from the size declared with odb_writer()
391-
/// Attepting write after finishing will be ignored.
391+
/// Attempting write after finishing will be ignored.
392392
pub fn finalize(&mut self) -> Result<Oid, Error> {
393393
let mut raw = raw::git_oid {
394394
id: [0; raw::GIT_OID_RAWSZ],

src/oid_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use std::slice;
1010

1111
/// An oid array structure used by libgit2
1212
///
13-
/// Some apis return arrays of oids which originate from libgit2. This
13+
/// Some APIs return arrays of OIDs which originate from libgit2. This
1414
/// wrapper type behaves a little like `Vec<&Oid>` but does so without copying
1515
/// the underlying Oids until necessary.
1616
pub struct OidArray {

src/opts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ where
181181
Ok(())
182182
}
183183

184-
/// Set wheter or not to verify ownership before performing a repository.
184+
/// Set whether or not to verify ownership before performing a repository.
185185
/// Enabled by default, but disabling this can lead to code execution vulnerabilities.
186186
pub unsafe fn set_verify_owner_validation(enabled: bool) -> Result<(), Error> {
187187
crate::init();

src/remote.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'repo> Remote<'repo> {
9797

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

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

136-
/// Get the remote's url as a byte array.
136+
/// Get the remote's URL as a byte array.
137137
pub fn url_bytes(&self) -> &[u8] {
138138
unsafe { crate::opt_bytes(self, raw::git_remote_url(&*self.raw)).unwrap() }
139139
}
@@ -246,7 +246,7 @@ impl<'repo> Remote<'repo> {
246246
/// Cancel the operation
247247
///
248248
/// At certain points in its operation, the network code checks whether the
249-
/// operation has been cancelled and if so stops the operation.
249+
/// operation has been canceled and if so stops the operation.
250250
pub fn stop(&mut self) -> Result<(), Error> {
251251
unsafe {
252252
try_call!(raw::git_remote_stop(self.raw));

src/remote_callbacks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ pub struct RemoteCallbacks<'a> {
3030
/// Callback used to acquire credentials for when a remote is fetched.
3131
///
3232
/// * `url` - the resource for which the credentials are required.
33-
/// * `username_from_url` - the username that was embedded in the url, or `None`
33+
/// * `username_from_url` - the username that was embedded in the URL, or `None`
3434
/// if it was not included.
35-
/// * `allowed_types` - a bitmask stating which cred types are ok to return.
35+
/// * `allowed_types` - a bitmask stating which cred types are OK to return.
3636
pub type Credentials<'a> =
3737
dyn FnMut(&str, Option<&str>, CredentialType) -> Result<Cred, Error> + 'a;
3838

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

4747
/// Callback for a custom certificate check.
4848
///
49-
/// The first argument is the certificate receved on the connection.
49+
/// The first argument is the certificate received on the connection.
5050
/// Certificates are typically either an SSH or X509 certificate.
5151
///
5252
/// The second argument is the hostname for the connection is passed as the last

src/repo.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ impl Repository {
626626

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

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

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

32843284
/// The path to the working directory.
32853285
///
3286-
/// If this is a relative path it will be evaulated relative to the repo
3286+
/// If this is a relative path it will be evaluated relative to the repo
32873287
/// path. If this is not the "natural" working directory, a .git gitlink
32883288
/// file will be created here linking to the repo path.
32893289
pub fn workdir_path(&mut self, path: &Path) -> &mut RepositoryInitOptions {

src/revwalk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub struct Revwalk<'repo> {
1212
_marker: marker::PhantomData<&'repo Repository>,
1313
}
1414

15-
/// A `Revwalk` with an assiciated "hide callback", see `with_hide_callback`
15+
/// A `Revwalk` with an associated "hide callback", see `with_hide_callback`
1616
pub struct RevwalkWithHideCb<'repo, 'cb, C>
1717
where
1818
C: FnMut(Oid) -> bool,

src/string_array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::util::Binding;
88

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

0 commit comments

Comments
 (0)