Fix handling of '.' as tree_path in get_tree function#20
Conversation
When tree_path is '.', the current code constructs invalid paths like '/path/to/repo./' which causes "Invalid directory path" errors. This fix adds special handling for '.' (current directory) to avoid path modification while still handling .git suffix removal properly. Fixes #19 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
TitleFix handling of '.' as tree_path in get_tree function User descriptionWhen tree_path is '.', the current code constructs invalid paths like '/path/to/repo./' which causes "Invalid directory path" errors. This fix adds special handling for '.' (current directory) to avoid path modification while still handling .git suffix removal properly. Fixes #19 🤖 Generated with Claude Code PR TypeBug fix Description
Changes diagramflowchart LR
A["tree_path input"] --> B{"tree_path == '.'?"}
B -->|Yes| C["Handle current directory"]
B -->|No| D["Original path logic"]
C --> E{"path has .git suffix?"}
E -->|Yes| F["Remove .git suffix"]
E -->|No| G["Use path as-is"]
D --> H["Append '/' and process"]
F --> I["Return processed path"]
G --> I
H --> I
Changes walkthrough 📝
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||
|
Seems like a easy review fix, forgotten, tentatively adding to the next sprint. |
Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label
|
|||||||||||||||||||||||||||
When tree_path is '.', the current code constructs invalid paths like '/path/to/repo./' which causes "Invalid directory path" errors.
This fix adds special handling for '.' (current directory) to avoid path modification while still handling .git suffix removal properly.
Fixes #19
🤖 Generated with Claude Code