Skip to content

Commit b26e5eb

Browse files
committed
Fix hook assignments
1 parent 1f6f7b3 commit b26e5eb

File tree

1 file changed

+3
-5
lines changed
  • crates/but-claude/src/hooks

1 file changed

+3
-5
lines changed

crates/but-claude/src/hooks/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ pub fn handle_post_tool_call() -> anyhow::Result<ClaudeHookOutput> {
371371
.strip_prefix(project.path.clone())?
372372
.to_string_lossy()
373373
.to_string();
374-
input.tool_response.file_path = relative_file_path;
374+
input.tool_response.file_path = relative_file_path.clone();
375375

376376
let ctx = &mut CommandContext::open(&project, AppSettings::load_from_default_path_creating()?)?;
377377

@@ -406,16 +406,14 @@ pub fn handle_post_tool_call() -> anyhow::Result<ClaudeHookOutput> {
406406
None,
407407
)?;
408408

409-
let file_path = Path::new(&input.tool_response.file_path).strip_prefix(project.path.clone())?;
410-
411409
let assignment_reqs: Vec<HunkAssignmentRequest> = assignments
412410
.into_iter()
413411
.filter(|a| a.stack_id.is_none())
414412
.filter(|a| {
415413
// If the hook_headers is empty, we probably created a file.
416414
if hook_headers.is_empty() {
417-
Path::new(&a.path) == file_path
418-
} else if Path::new(&a.path) == file_path {
415+
a.path.to_lowercase() == relative_file_path.to_lowercase()
416+
} else if a.path.to_lowercase() == relative_file_path.to_lowercase() {
419417
if let Some(a) = a.hunk_header {
420418
hook_headers
421419
.iter()

0 commit comments

Comments
 (0)