-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit d2e994d
Move git config/remote to gitrepo package and add global lock to resolve possible conflict when updating repository git config file (#35151)
Partially fix #32018
`git config` and `git remote` write operations create a temporary file
named `config.lock`. Since these operations are not atomic, they must
not be run in parallel. If two requests attempt to modify the same
repository concurrently—such as during a compare operation—one may fail
due to the presence of an existing `config.lock` file.
In cases where `config.lock` is left behind due to an unexpected program
exit, a global lock mechanism could allow us to safely remove the stale
lock file when a related error is detected. While this behavior is not
yet implemented in this PR, it is planned for a future enhancement.
---------
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>1 parent 4e1b8db commit d2e994d
File tree
19 files changed
+312
-225
lines changed- modules
- gitrepo
- git
- templates
- routers
- api/v1/repo
- common
- web/repo
- setting
- services
- doctor
- issue
- mirror
- pull
- repository
19 files changed
+312
-225
lines changedLines changed: 0 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
9 | 9 |
| |
10 | 10 |
| |
11 | 11 |
| |
12 | - | ||
13 | 12 |
| |
14 | 13 |
| |
15 | 14 |
| |
| |||
33 | 32 |
| |
34 | 33 |
| |
35 | 34 |
| |
36 | - | ||
37 | - | ||
38 | - | ||
39 | - | ||
40 | - | ||
41 | - | ||
42 | - | ||
43 | - | ||
44 | - | ||
45 | 35 |
| |
46 | 36 |
| |
47 | 37 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
41 | 52 |
| |
42 | 53 |
| |
43 | 54 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 | - | ||
83 | - | ||
84 | - | ||
85 | - | ||
86 | - | ||
87 | - | ||
88 | 82 |
| |
89 | 83 |
| |
90 | 84 |
| |
|
Lines changed: 0 additions & 89 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
19 | - | ||
20 | - | ||
21 | - | ||
22 | 19 |
| |
23 | 20 |
| |
24 | - | ||
25 | - | ||
26 | - | ||
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | ||
31 | - | ||
32 | - | ||
33 | 21 |
| |
34 | 22 |
| |
35 | 23 |
| |
| |||
49 | 37 |
| |
50 | 38 |
| |
51 | 39 |
| |
52 | - | ||
53 | - | ||
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 | - | ||
84 | - | ||
85 | - | ||
86 | - | ||
87 | - | ||
88 | - | ||
89 | - | ||
90 | - | ||
91 | - | ||
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | ||
96 | - | ||
97 | - | ||
98 | - | ||
99 | - | ||
100 | - | ||
101 | - | ||
102 | - | ||
103 | - | ||
104 | - | ||
105 | - | ||
106 | - | ||
107 | - | ||
108 | - | ||
109 | - | ||
110 | - | ||
111 | - | ||
112 | - | ||
113 | - | ||
114 | - | ||
115 | - | ||
116 | - | ||
117 | - | ||
118 | - | ||
119 | - | ||
120 | - | ||
121 | - | ||
122 | - | ||
123 | - | ||
124 | - | ||
125 | - | ||
126 | - | ||
127 | - | ||
128 | - | ||
129 | 40 |
| |
130 | 41 |
| |
131 | 42 |
| |
|
Lines changed: 48 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + |
Lines changed: 85 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | + | ||
2 | + | ||
3 | + | ||
4 | + | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
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 | + | ||
84 | + | ||
85 | + |
Lines changed: 2 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 | - | ||
18 | - | ||
17 | + | ||
19 | 18 |
| |
20 | 19 |
| |
21 | 20 |
| |
| |||
145 | 144 |
| |
146 | 145 |
| |
147 | 146 |
| |
148 | - | ||
147 | + | ||
149 | 148 |
| |
150 | 149 |
| |
151 | 150 |
| |
152 | 151 |
| |
153 | 152 |
| |
154 | - | ||
155 | - | ||
156 | - | ||
157 | - | ||
158 | - | ||
159 | - | ||
160 | 153 |
| |
161 | 154 |
| |
162 | 155 |
| |
|
Lines changed: 8 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1085 | 1085 |
| |
1086 | 1086 |
| |
1087 | 1087 |
| |
1088 | - | ||
1088 | + | ||
1089 | 1089 |
| |
1090 | 1090 |
| |
1091 | 1091 |
| |
| |||
1201 | 1201 |
| |
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 | - | ||
1204 | + | ||
1205 | 1205 |
| |
1206 | 1206 |
| |
1207 | 1207 |
| |
| |||
1452 | 1452 |
| |
1453 | 1453 |
| |
1454 | 1454 |
| |
1455 | - | ||
1455 | + | ||
1456 | 1456 |
| |
1457 | 1457 |
| |
1458 | 1458 |
| |
| |||
1461 | 1461 |
| |
1462 | 1462 |
| |
1463 | 1463 |
| |
1464 | - | ||
1464 | + | ||
1465 | 1465 |
| |
1466 | - | ||
1466 | + | ||
1467 | 1467 |
| |
1468 | 1468 |
| |
1469 | 1469 |
| |
| |||
1582 | 1582 |
| |
1583 | 1583 |
| |
1584 | 1584 |
| |
1585 | - | ||
1585 | + | ||
1586 | 1586 |
| |
1587 | - | ||
1587 | + | ||
1588 | 1588 |
| |
1589 | - | ||
1589 | + | ||
1590 | 1590 |
| |
1591 | 1591 |
| |
1592 | 1592 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 | + | ||
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
15 | 16 |
| |
16 | 17 |
| |
17 | - | ||
18 | + | ||
18 | 19 |
| |
19 | 20 |
| |
20 | 21 |
| |
|
0 commit comments