aboutsummaryrefslogtreecommitdiff
path: root/src/workspace/git/status.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/workspace/git/status.rs')
-rw-r--r--src/workspace/git/status.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/workspace/git/status.rs b/src/workspace/git/status.rs
index 4fb2b887..9f40170c 100644
--- a/src/workspace/git/status.rs
+++ b/src/workspace/git/status.rs
@@ -8,7 +8,8 @@ use super::{
discovery::{
automatic_workspace_label, canonicalize_best_effort_path, fallback_label_from_cwd,
git_ref_storage_is_reftable, git_rev_parse_verify, git_space_metadata_from_info,
- git_symbolic_head_full, git_worktree_info, read_ref_oid, GitWorktreeInfo,
+ git_symbolic_head_full, git_worktree_info, read_git_ref_file, read_ref_oid,
+ GitWorktreeInfo,
},
};
@@ -273,7 +274,7 @@ fn read_head_identity_from_git(info: &GitWorktreeInfo) -> Option<GitHeadIdentity
}
fn read_head_identity_from_files(info: &GitWorktreeInfo) -> Option<GitHeadIdentity> {
- let head = std::fs::read_to_string(info.git_dir.join("HEAD")).ok()?;
+ let head = read_git_ref_file(&info.git_dir.join("HEAD"))?;
let head = head.trim();
if let Some(full_ref) = head.strip_prefix("ref: ") {
let short_name = full_ref.strip_prefix("refs/heads/")?.to_string();