use std::path::{Path, PathBuf};
pub const PACKED_REFS: &str = "packed-refs";
#[must_use]
pub const fn packed_refs_rel() -> &'static str {
PACKED_REFS
}
#[must_use]
pub fn packed_refs_path(common_dir: &Path) -> PathBuf {
common_dir.join(packed_refs_rel())
}
#[must_use]
pub fn logs_refs_rel() -> &'static str {
"logs/refs"
}
pub const LOGS_REFS_BISECT: &str = "logs/refs/bisect";
pub const LOGS_REFS_REWRITTEN: &str = "logs/refs/rewritten";
pub const LOGS_REFS_WORKTREE: &str = "logs/refs/worktree";
pub const LOGS_REFS_HEADS_MAIN: &str = "logs/refs/heads/main";
#[must_use]
pub fn logs_refs_child(suffix: &str) -> String {
format!("{}/{}", logs_refs_rel(), suffix)
}
#[must_use]
pub fn logs_dir_path(git_or_common: &Path) -> PathBuf {
git_or_common.join("logs")
}
#[must_use]
pub fn logs_refs_dir_path(git_or_common: &Path) -> PathBuf {
git_or_common.join(logs_refs_rel())
}
#[must_use]
pub fn logs_refs_subdir_path(git_or_common: &Path, suffix: &str) -> PathBuf {
logs_refs_dir_path(git_or_common).join(suffix)
}
#[must_use]
pub fn logs_refs_from_logs_root(logs_root: &Path) -> PathBuf {
logs_root.join("refs")
}