Skip to content

No changes needed - file existence check already present in normalize-path#158

Closed
Copilot wants to merge 1 commit intokang_featfrom
copilot/sub-pr-155-another-one
Closed

No changes needed - file existence check already present in normalize-path#158
Copilot wants to merge 1 commit intokang_featfrom
copilot/sub-pr-155-another-one

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 5, 2026

Addresses review feedback on PR #155 questioning whether file-truename would break on non-existent files.

Analysis

file-truename signals file-error when called on non-existent files per Emacs Lisp spec. The current implementation is already safe:

(defun ai-code--normalize-path (file)
  "Return normalized absolute path for FILE.
If FILE exists, return its truename. Otherwise return expanded path."
  (let ((full (expand-file-name file)))
    (if (file-exists-p full)
        (file-truename full)  ; Only called when file exists
      full)))                 ; Fallback for non-existent files

Status

  • File existence check was preserved during refactoring in commit 74100af
  • Test coverage exists in ai-code-test-normalize-path
  • No code changes required

The bot reviewer's suggestion to always call file-truename would have been incorrect.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Update candidate filepath list enhancement for file existence check No changes needed - file existence check already present in normalize-path Feb 5, 2026
Copilot AI requested a review from tninja February 5, 2026 02:39
@tninja tninja closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants