summaryrefslogtreecommitdiffstats
path: root/vendor/gix-index/src/entry
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:42 +0000
commitcec1877e180393eba0f6ddb0cf97bf3a791631c7 (patch)
tree47b4dac2a9dd9a40c30c251b4d4a72d7ccf77e9f /vendor/gix-index/src/entry
parentAdding debian version 1.74.1+dfsg1-1. (diff)
downloadrustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.tar.xz
rustc-cec1877e180393eba0f6ddb0cf97bf3a791631c7.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-index/src/entry')
-rw-r--r--vendor/gix-index/src/entry/mod.rs8
-rw-r--r--vendor/gix-index/src/entry/stat.rs31
2 files changed, 22 insertions, 17 deletions
diff --git a/vendor/gix-index/src/entry/mod.rs b/vendor/gix-index/src/entry/mod.rs
index e680e08b0..2f257ef63 100644
--- a/vendor/gix-index/src/entry/mod.rs
+++ b/vendor/gix-index/src/entry/mod.rs
@@ -1,4 +1,8 @@
-/// The stage of an entry, one of 0 = base, 1 = ours, 2 = theirs
+/// The stage of an entry, one of…
+/// * 0 = no conflict,
+/// * 1 = base,
+/// * 2 = ours,
+/// * 3 = theirs
pub type Stage = u32;
///
@@ -71,7 +75,7 @@ mod access {
backing[self.path.clone()].as_bstr()
}
- /// Return an entry's stage.
+ /// Return an entry's stage. See [entry::Stage] for possible values.
pub fn stage(&self) -> entry::Stage {
self.flags.stage()
}
diff --git a/vendor/gix-index/src/entry/stat.rs b/vendor/gix-index/src/entry/stat.rs
index 7bde71763..5e60f8540 100644
--- a/vendor/gix-index/src/entry/stat.rs
+++ b/vendor/gix-index/src/entry/stat.rs
@@ -92,21 +92,22 @@ impl Stat {
size: fstat.len() as u32,
};
#[cfg(unix)]
- use std::os::unix::fs::MetadataExt;
- #[cfg(unix)]
- let res = Stat {
- mtime: mtime.try_into().unwrap_or_default(),
- ctime: ctime.try_into().unwrap_or_default(),
- // truncating to 32 bits is fine here because
- // that's what the linux syscalls returns
- // just rust upcasts to 64 bits for some reason?
- // numbers this large are impractical anyway (that's a lot of hard-drives).
- dev: fstat.dev() as u32,
- ino: fstat.ino() as u32,
- uid: fstat.uid(),
- gid: fstat.gid(),
- // truncation to 32 bits is on purpose (git does the same).
- size: fstat.len() as u32,
+ let res = {
+ use std::os::unix::fs::MetadataExt;
+ Stat {
+ mtime: mtime.try_into().unwrap_or_default(),
+ ctime: ctime.try_into().unwrap_or_default(),
+ // truncating to 32 bits is fine here because
+ // that's what the linux syscalls returns
+ // just rust upcasts to 64 bits for some reason?
+ // numbers this large are impractical anyway (that's a lot of hard-drives).
+ dev: fstat.dev() as u32,
+ ino: fstat.ino() as u32,
+ uid: fstat.uid(),
+ gid: fstat.gid(),
+ // truncation to 32 bits is on purpose (git does the same).
+ size: fstat.len() as u32,
+ }
};
Ok(res)