Commit 6d981c2
committed
Set the write bit for files written during template initialization
This used to work because the permission bits for builtin templates were
hardcoded to 0644 for files and 0755 for directories.
As of #1912 (and the PRs it depends on), builtin templates are no longer
pre-materialized to a temporary directory and read directly from the embedded
filesystem. It turns out that this builtin filesystem returns 0444 as the
permission bits for the files it contains. These bits are carried over to the
destination filesystem.
This change updates template materialization to always set the owner's write
bit. It doesn't really make sense to write read-only files and expect users to
work with these files in a VCS (note: Git only stores the executable bit).
The regression shipped as part of v0.235.0 and will be fixed as of v0.238.0.1 parent 60782b5 commit 6d981c2
File tree
4 files changed
+48
-22
lines changed- internal/testutil
- libs/template
4 files changed
+48
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
| 52 | + | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
155 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 30 | | |
43 | 31 | | |
44 | 32 | | |
| |||
69 | 57 | | |
70 | 58 | | |
71 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
72 | 64 | | |
73 | 65 | | |
74 | 66 | | |
| |||
347 | 339 | | |
348 | 340 | | |
349 | 341 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
354 | 346 | | |
355 | 347 | | |
356 | 348 | | |
| |||
617 | 609 | | |
618 | 610 | | |
619 | 611 | | |
620 | | - | |
621 | | - | |
| 612 | + | |
| 613 | + | |
622 | 614 | | |
623 | 615 | | |
624 | 616 | | |
| |||
0 commit comments