Commit c4e7b75
committed
fix(doctor): preserve config file permissions and skip no-op writes
commentForkPointChange was writing .git/config with hardcoded 0644,
which could loosen permissions if the file was e.g. 0600. Now
preserves the existing file mode via os.Stat. Also skips the write
entirely when no provenance comment was inserted.1 parent 2bb8d3f commit c4e7b75
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
253 | 257 | | |
254 | 258 | | |
255 | 259 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
| 265 | + | |
261 | 266 | | |
262 | 267 | | |
263 | 268 | | |
| |||
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
| 290 | + | |
285 | 291 | | |
286 | 292 | | |
287 | 293 | | |
288 | 294 | | |
289 | 295 | | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
290 | 299 | | |
291 | | - | |
| 300 | + | |
292 | 301 | | |
0 commit comments