@@ -47,6 +47,9 @@ async def post(self):
47
47
response = await self .git .clone (
48
48
data ["current_path" ], data ["clone_url" ], data .get ("auth" , None )
49
49
)
50
+
51
+ if response ["code" ] != 0 :
52
+ self .set_status (500 )
50
53
self .finish (json .dumps (response ))
51
54
52
55
@@ -72,6 +75,7 @@ async def post(self):
72
75
73
76
show_top_level = await self .git .show_top_level (current_path )
74
77
if show_top_level ["code" ] != 0 :
78
+ self .set_status (500 )
75
79
self .finish (json .dumps (show_top_level ))
76
80
else :
77
81
branch = await self .git .branch (current_path )
@@ -103,6 +107,9 @@ async def post(self):
103
107
"""
104
108
current_path = self .get_json_body ()["current_path" ]
105
109
result = await self .git .show_top_level (current_path )
110
+
111
+ if result ["code" ] != 0 :
112
+ self .set_status (500 )
106
113
self .finish (json .dumps (result ))
107
114
108
115
@@ -121,6 +128,9 @@ async def post(self):
121
128
"""
122
129
current_path = self .get_json_body ()["current_path" ]
123
130
result = await self .git .show_prefix (current_path )
131
+
132
+ if result ["code" ] != 0 :
133
+ self .set_status (500 )
124
134
self .finish (json .dumps (result ))
125
135
126
136
@@ -136,6 +146,9 @@ async def post(self):
136
146
"""
137
147
current_path = self .get_json_body ()["current_path" ]
138
148
result = await self .git .status (current_path )
149
+
150
+ if result ["code" ] != 0 :
151
+ self .set_status (500 )
139
152
self .finish (json .dumps (result ))
140
153
141
154
@@ -155,6 +168,9 @@ async def post(self):
155
168
current_path = body ["current_path" ]
156
169
history_count = body .get ("history_count" , 25 )
157
170
result = await self .git .log (current_path , history_count )
171
+
172
+ if result ["code" ] != 0 :
173
+ self .set_status (500 )
158
174
self .finish (json .dumps (result ))
159
175
160
176
@@ -194,6 +210,9 @@ async def post(self):
194
210
"""
195
211
top_repo_path = self .get_json_body ()["top_repo_path" ]
196
212
my_output = await self .git .diff (top_repo_path )
213
+
214
+ if my_output ["code" ] != 0 :
215
+ self .set_status (500 )
197
216
self .finish (my_output )
198
217
199
218
@@ -556,6 +575,9 @@ class GitChangedFilesHandler(GitHandler):
556
575
@web .authenticated
557
576
async def post (self ):
558
577
body = await self .git .changed_files (** self .get_json_body ())
578
+
579
+ if body ["code" ] != 0 :
580
+ self .set_status (500 )
559
581
self .finish (json .dumps (body ))
560
582
561
583
0 commit comments