Skip to content

Conversation

Copy link

Copilot AI commented Dec 24, 2025

This PR was created to address feedback on path sanitization in #14. However, the improvements have already been implemented in commit 2880e7e.

Current Implementation

The path sanitization logic now handles:

  • POSIX absolute paths (/path/to/file)
  • Windows absolute paths (C:\path or D:/path)
  • Home-relative paths (~/.config)
  • Relative traversals (../sensitive)
  • Separate sanitization for exact repo_path match vs generic paths
def _looks_like_path(arg: str) -> bool:
    if not arg:
        return False
    if arg.startswith("/"):
        return True
    if len(arg) >= 3 and arg[1] == ":" and arg[2] in ("/", "\\"):
        return True
    if arg.startswith("~"):
        return True
    return bool(arg.startswith(".."))

This prevents filesystem path leakage in error messages while avoiding over-sanitization of git arguments that legitimately contain / (e.g., format strings, refspecs).

Status

No additional changes required. The feedback has been fully addressed.


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

Copilot AI changed the title [WIP] Update path sanitization based on review feedback No changes needed - path sanitization improvements already implemented Dec 24, 2025
Copilot AI requested a review from zircote December 24, 2025 11:02
@zircote zircote closed this Dec 24, 2025
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