@@ -10,13 +10,13 @@ use std::ops::Deref;
1010#[ napi]
1111#[ repr( u32 ) ]
1212pub enum DiffFlags {
13- /// File(s) treated as binary data. (1 << 0)
13+ /// File(s) treated as binary data.
1414 Binary = 1 ,
15- /// File(s) treated as text data. (1 << 1)
15+ /// File(s) treated as text data.
1616 NotBinary = 2 ,
17- /// `id` value is known correct. (1 << 2)
17+ /// `id` value is known correct.
1818 ValidId = 4 ,
19- /// File exists at this side of the delta. (1 << 3)
19+ /// File exists at this side of the delta.
2020 Exists = 8 ,
2121}
2222
@@ -34,9 +34,9 @@ pub fn diff_flags_contains(source: u32, target: u32) -> bool {
3434pub enum DeltaType {
3535 /// No changes
3636 Unmodified ,
37- /// Entry does not exist in old version
37+ /// Entry does not exist in an old version
3838 Added ,
39- /// Entry does not exist in new version
39+ /// Entry does not exist in a new version
4040 Deleted ,
4141 /// Entry content changed between old and new
4242 Modified ,
@@ -93,19 +93,19 @@ impl From<DeltaType> for git2::Delta {
9393}
9494
9595#[ napi( string_enum) ]
96- /// Possible output formats for diff data
96+ /// Possible output formats for diff data.
9797pub enum DiffFormat {
98- /// full git diff (default)
98+ /// full ` git diff` (default)
9999 Patch ,
100100 /// just the headers of the patch
101101 PatchHeader ,
102- /// like git diff --raw
102+ /// like ` git diff --raw`
103103 Raw ,
104- /// like git diff --name-only
104+ /// like ` git diff --name-only`
105105 NameOnly ,
106- /// like git diff --name-status
106+ /// like ` git diff --name-status`
107107 NameStatus ,
108- /// git diff as used by git patch-id
108+ /// ` git diff` as used by ` git patch-id`
109109 PatchId ,
110110}
111111
@@ -137,8 +137,8 @@ pub struct DiffPrintOptions {
137137/// The diff object that contains all individual file deltas.
138138///
139139/// This is an opaque structure which will be allocated by one of the diff
140- /// generator functions on the `Repository` structure (e.g. `diff_tree_to_tree `
141- /// or other `diff_ *` functions).
140+ /// generator functions on the `Repository` class (e.g. `diffTreeToTree `
141+ /// or other `diff *` functions).
142142///
143143/// @hideconstructor
144144pub struct Diff {
@@ -199,7 +199,7 @@ impl Diff {
199199}
200200
201201#[ napi]
202- /// Structure describing a hunk of a diff.
202+ /// A class describing a hunk of a diff.
203203///
204204/// @hideconstructor
205205pub struct DiffStats {
@@ -228,7 +228,7 @@ impl DiffStats {
228228}
229229
230230#[ napi( iterator) ]
231- /// An iterator over the diffs in a delta
231+ /// An iterator over the diffs in a delta.
232232///
233233/// @hideconstructor
234234pub struct Deltas {
@@ -271,7 +271,7 @@ impl DiffDelta {
271271 }
272272
273273 #[ napi]
274- /// Returns the status of this entry
274+ /// Returns the status of this entry.
275275 pub fn status ( & self ) -> DeltaType {
276276 self . inner . status ( ) . into ( )
277277 }
@@ -357,7 +357,7 @@ impl DiffFile {
357357 #[ napi]
358358 /// Returns the Oid of this item.
359359 ///
360- /// If this entry represents an absent side of a diff (e.g. the `old_file `
360+ /// If this entry represents an absent side of a diff (e.g. the `oldFile `
361361 /// of a `Added` delta), then the oid returned will be zeroes.
362362 pub fn id ( & self ) -> String {
363363 self . inner . id ( ) . to_string ( )
@@ -371,7 +371,7 @@ impl DiffFile {
371371 }
372372
373373 #[ napi]
374- /// Returns the size of this entry, in bytes
374+ /// Returns the size of this entry, in bytes.
375375 pub fn size ( & self ) -> u64 {
376376 self . inner . size ( )
377377 }
@@ -402,7 +402,7 @@ impl DiffFile {
402402}
403403
404404#[ napi( object) ]
405- /// Structure describing options about how the diff should be executed.
405+ /// Describing options about how the diff should be executed.
406406pub struct DiffOptions {
407407 /// Flag indicating whether the sides of the diff will be reversed.
408408 pub reverse : Option < bool > ,
@@ -643,10 +643,10 @@ impl Repository {
643643 #[ napi]
644644 /// Create a diff with the difference between two tree objects.
645645 ///
646- /// This is equivalent to `git diff <old-tree> <new-tree>`
646+ /// This is equivalent to `git diff <old-tree> <new-tree>`.
647647 ///
648- /// The first tree will be used for the "old_file " side of the delta and the
649- /// second tree will be used for the "new_file " side of the delta. You can
648+ /// The first tree will be used for the "oldFile " side of the delta and the
649+ /// second tree will be used for the "newFile " side of the delta. You can
650650 /// pass `null` to indicate an empty tree, although it is an error to pass
651651 /// `null` for both the `oldTree` and `newTree`.
652652 pub fn diff_tree_to_tree (
@@ -675,8 +675,8 @@ impl Repository {
675675 #[ napi]
676676 /// Create a diff between two index objects.
677677 ///
678- /// The first index will be used for the "old_file " side of the delta, and
679- /// the second index will be used for the "new_file " side of the delta.
678+ /// The first index will be used for the "oldFile " side of the delta, and
679+ /// the second index will be used for the "newFile " side of the delta.
680680 pub fn diff_index_to_index (
681681 & self ,
682682 env : Env ,
@@ -700,12 +700,12 @@ impl Repository {
700700 /// Create a diff between the repository index and the workdir directory.
701701 ///
702702 /// This matches the `git diff` command. See the note below on
703- /// `tree_to_workdir ` for a discussion of the difference between
703+ /// `diffTreeToWorkdir ` for a discussion of the difference between
704704 /// `git diff` and `git diff HEAD` and how to emulate a `git diff <treeish>`
705705 /// using libgit2.
706706 ///
707- /// The index will be used for the "old_file " side of the delta, and the
708- /// working directory will be used for the "new_file " side of the delta.
707+ /// The index will be used for the "oldFile " side of the delta, and the
708+ /// working directory will be used for the "newFile " side of the delta.
709709 ///
710710 /// If you pass `null` for the index, then the existing index of the `repo`
711711 /// will be used. In this case, the index will be refreshed from disk
@@ -731,18 +731,18 @@ impl Repository {
731731 #[ napi]
732732 /// Create a diff between a tree and the working directory.
733733 ///
734- /// The tree you provide will be used for the "old_file " side of the delta,
735- /// and the working directory will be used for the "new_file " side.
734+ /// The tree you provide will be used for the "oldFile " side of the delta,
735+ /// and the working directory will be used for the "newFile " side.
736736 ///
737737 /// This is not the same as `git diff <treeish>` or `git diff-index <treeish>`.
738738 /// Those commands use information from the index, whereas this
739739 /// function strictly returns the differences between the tree and the files
740- /// in the working directory, regardless of the state of the index. Use
741- /// `tree_to_workdir_with_index ` to emulate those commands.
740+ /// in the working directory, regardless of the state of the index. Use
741+ /// `diffTreeToWorkdirWithIndex ` to emulate those commands.
742742 ///
743- /// To see difference between this and `tree_to_workdir_with_index `,
743+ /// To see difference between this and `diffTreeToWorkdirWithIndex `,
744744 /// consider the example of a staged file deletion where the file has then
745- /// been put back into the working dir and further modified. The
745+ /// been put back into the working dir and further modified. The
746746 /// tree-to-workdir diff for that file is 'modified', but `git diff` would
747747 /// show status 'deleted' since there is a staged delete.
748748 ///
0 commit comments