Commit e801fa2
committed
feat: Add git repository root path normalization for code blocks
Introduce path normalization logic to handle absolute file paths relative to the git repository root. This enhances file handling for markdown code block extraction and application, particularly for scripts operating across different repository contexts.
Key improvements:
- Add `get_git_root()` function to detect git repository root
- Implement `normalize_path()` function to resolve absolute paths
- Provide verbose warnings when not in a git repository
- Improve path resolution for code block file targets1 parent c858914 commit e801fa2
1 file changed
+30
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
18 | 23 | | |
19 | 24 | | |
20 | 25 | | |
| |||
49 | 54 | | |
50 | 55 | | |
51 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
52 | 63 | | |
53 | 64 | | |
54 | 65 | | |
| |||
72 | 83 | | |
73 | 84 | | |
74 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
75 | 98 | | |
76 | 99 | | |
77 | 100 | | |
| |||
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
| 107 | + | |
84 | 108 | | |
85 | 109 | | |
86 | 110 | | |
87 | 111 | | |
88 | 112 | | |
89 | | - | |
| 113 | + | |
90 | 114 | | |
91 | 115 | | |
92 | 116 | | |
| |||
137 | 161 | | |
138 | 162 | | |
139 | 163 | | |
140 | | - | |
| 164 | + | |
| 165 | + | |
141 | 166 | | |
142 | 167 | | |
143 | 168 | | |
| |||
223 | 248 | | |
224 | 249 | | |
225 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
226 | 254 | | |
227 | 255 | | |
228 | 256 | | |
| |||
0 commit comments