File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,21 @@ pub struct IndexEntry {
66
66
pub id : Oid ,
67
67
pub flags : u16 ,
68
68
pub flags_extended : u16 ,
69
+
70
+ /// The path of this index entry as a byte vector. Regardless of the
71
+ /// current platform, the directory separator is an ASCII forward slash
72
+ /// (`0x2F`). There are no terminating or internal NUL characters, and no
73
+ /// trailing slashes. Most of the time, paths will be valid utf-8 — but
74
+ /// not always. For more information on the path storage format, see
75
+ /// [these git docs][git-index-docs]. Note that libgit2 will take care of
76
+ /// handling the prefix compression mentioned there.
77
+ ///
78
+ /// [git-index-docs]: https://github.com/git/git/blob/a08a83db2bf27f015bec9a435f6d73e223c21c5e/Documentation/technical/index-format.txt#L107-L124
79
+ ///
80
+ /// You can turn this value into a `std::ffi::CString` with
81
+ /// `CString::new(&entry.path[..]).unwrap()`. To turn a reference into a
82
+ /// `&std::path::Path`, see the `bytes2path()` function in the private,
83
+ /// internal `util` module in this crate’s source code.
69
84
pub path : Vec < u8 > ,
70
85
}
71
86
You can’t perform that action at this time.
0 commit comments