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();

0 commit comments

Comments
 (0)