Commit abc59930d57a2d46c310e1b0c758c948554bc1af

Christian Weisgerber 2021-09-05T19:41:03

indentation fixes

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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
diff --git a/got/got.c b/got/got.c
index 2b61384..e7638e1 100644
--- a/got/got.c
+++ b/got/got.c
@@ -7818,7 +7818,7 @@ cmd_send(int argc, char *argv[])
 		} else
 			ref = head_ref;
 		error = got_pathlist_append(&branches, got_ref_get_name(ref),
-		   NULL);
+		    NULL);
 		if (error)
 			goto done;
 		nbranches++;
@@ -8615,8 +8615,8 @@ process_backup_refs(const char *backup_ref_prefix, const char *wanted_branch_nam
 				    old_commit_id, repo);
 			} else {
 				err = print_backup_ref(branch_name, refname,
-				   old_commit_id, old_commit, refs_idmap,
-				   repo);
+				    old_commit_id, old_commit, refs_idmap,
+				    repo);
 			}
 			if (err)
 				break;
diff --git a/gotadmin/gotadmin.c b/gotadmin/gotadmin.c
index cad8fd5..af38ca1 100644
--- a/gotadmin/gotadmin.c
+++ b/gotadmin/gotadmin.c
@@ -1074,8 +1074,8 @@ cmd_cleanup(int argc, char *argv[])
 	cpa.dry_run = dry_run;
 	cpa.verbosity = verbosity;
 	error = got_repo_purge_unreferenced_loose_objects(repo,
-	   &size_before, &size_after, &npacked, dry_run, ignore_mtime,
-	   cleanup_progress, &cpa, check_cancelled, NULL);
+	    &size_before, &size_after, &npacked, dry_run, ignore_mtime,
+	    cleanup_progress, &cpa, check_cancelled, NULL);
 	if (cpa.printed_something)
 		printf("\n");
 	if (error)
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 360a75d..7b22d4a 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -2057,7 +2057,7 @@ gw_parse_querystring(struct gw_trans *gw_trans)
 			return error;
 		}
 
- 		if ((p = gw_trans->gw_req->fieldmap[KEY_COMMIT_ID])) {
+		if ((p = gw_trans->gw_req->fieldmap[KEY_COMMIT_ID])) {
 			if (asprintf(&gw_trans->commit_id, "%s",
 			    p->parsed.s) == -1)
 				return got_error_from_errno("asprintf");
@@ -2887,7 +2887,7 @@ gw_output_diff(struct gw_trans *gw_trans, struct gw_header *header)
 		break;
 	case GOT_OBJ_TYPE_TREE:
 		error = got_diff_objects_as_trees(NULL, NULL, id1, id2,
-		   "", "", 3, 0, 0, gw_trans->repo, f);
+		    "", "", 3, 0, 0, gw_trans->repo, f);
 		break;
 	case GOT_OBJ_TYPE_COMMIT:
 		error = got_diff_objects_as_commits(NULL, NULL, id1, id2,
diff --git a/include/got_worktree.h b/include/got_worktree.h
index 5cf8592..d9ae487 100644
--- a/include/got_worktree.h
+++ b/include/got_worktree.h
@@ -420,7 +420,7 @@ const struct got_error *got_worktree_get_histedit_script_path(char **,
  */
 const struct got_error *
 got_worktree_integrate_prepare(struct got_fileindex **,
-   struct got_reference **, struct got_reference **,
+    struct got_reference **, struct got_reference **,
     struct got_worktree *, const char *, struct got_repository *);
 
 /*
diff --git a/lib/diff3.c b/lib/diff3.c
index fa402b0..957c2c3 100644
--- a/lib/diff3.c
+++ b/lib/diff3.c
@@ -911,7 +911,7 @@ duplicate(int *dpl, int j, struct line_range *r1, struct line_range *r2,
 				    SEEK_CUR) == -1)
 					return got_ferror(d3s->fp[1],
 						GOT_ERR_IO);
- 				/* original lines end here */
+				/* original lines end here */
 				d3s->de[j + 1].oldo.to = off + orig_line_len;
 				err = repos(nchar, d3s);
 				if (err)
@@ -1014,8 +1014,8 @@ edscript(int n, struct diff3_state *d3s)
 			    GOT_DIFF_CONFLICT_MARKER_SEP);
 			if (err)
 				return err;
- 		} else {
- 			err = diff_output(d3s->diffbuf, "%da\n%s\n",
+		} else {
+			err = diff_output(d3s->diffbuf, "%da\n%s\n",
 			    d3s->de[n].old.to -1, GOT_DIFF_CONFLICT_MARKER_SEP);
 			if (err)
 				return err;
diff --git a/lib/got_lib_privsep.h b/lib/got_lib_privsep.h
index e60e8eb..ce62cbf 100644
--- a/lib/got_lib_privsep.h
+++ b/lib/got_lib_privsep.h
@@ -515,7 +515,7 @@ const struct got_error *got_privsep_recv_fetch_progress(int *,
     struct got_object_id **, char **, struct got_pathlist_head *, char **,
     off_t *, uint8_t *, struct imsgbuf *);
 const struct got_error *got_privsep_send_send_req(struct imsgbuf *, int,
-   struct got_pathlist_head *, struct got_pathlist_head *, int);
+    struct got_pathlist_head *, struct got_pathlist_head *, int);
 const struct got_error *got_privsep_recv_send_remote_refs(
     struct got_pathlist_head *, struct imsgbuf *);
 const struct got_error *got_privsep_send_packfd(struct imsgbuf *, int);
diff --git a/lib/got_lib_repository.h b/lib/got_lib_repository.h
index 7f21b68..743935e 100644
--- a/lib/got_lib_repository.h
+++ b/lib/got_lib_repository.h
@@ -48,7 +48,7 @@ struct got_repository {
 	int pack_cache_size;
 
 	/* Handles to child processes for reading loose objects. */
-	 struct got_privsep_child privsep_children[5];
+	struct got_privsep_child privsep_children[5];
 #define GOT_REPO_PRIVSEP_CHILD_OBJECT	0
 #define GOT_REPO_PRIVSEP_CHILD_COMMIT	1
 #define GOT_REPO_PRIVSEP_CHILD_TREE	2
diff --git a/lib/inflate.c b/lib/inflate.c
index 5cb13a5..e68e173 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -105,7 +105,7 @@ csum_output(struct got_inflate_checksum *csum, const char *buf, size_t len)
 
 const struct got_error *
 got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp,
-   size_t *consumed)
+    size_t *consumed)
 {
 	size_t last_total_out = zb->z.total_out;
 	size_t last_total_in = zb->z.total_in;
diff --git a/lib/privsep.c b/lib/privsep.c
index 4846f58..990151b 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -560,9 +560,9 @@ got_privsep_send_obj(struct imsgbuf *ibuf, struct got_object *obj)
 
 const struct got_error *
 got_privsep_send_fetch_req(struct imsgbuf *ibuf, int fd,
-   struct got_pathlist_head *have_refs, int fetch_all_branches,
-   struct got_pathlist_head *wanted_branches,
-   struct got_pathlist_head *wanted_refs, int list_refs_only, int verbosity)
+    struct got_pathlist_head *have_refs, int fetch_all_branches,
+    struct got_pathlist_head *wanted_branches,
+    struct got_pathlist_head *wanted_refs, int list_refs_only, int verbosity)
 {
 	const struct got_error *err = NULL;
 	struct ibuf *wbuf;
@@ -904,9 +904,9 @@ send_send_ref(const char *name, size_t name_len, struct got_object_id *id,
 
 const struct got_error *
 got_privsep_send_send_req(struct imsgbuf *ibuf, int fd,
-   struct got_pathlist_head *have_refs,
-   struct got_pathlist_head *delete_refs,
-   int verbosity)
+    struct got_pathlist_head *have_refs,
+    struct got_pathlist_head *delete_refs,
+    int verbosity)
 {
 	const struct got_error *err = NULL;
 	struct got_pathlist_entry *pe;
@@ -2619,7 +2619,7 @@ done:
 
 const struct got_error *
 got_privsep_send_commit_traversal_request(struct imsgbuf *ibuf,
-     struct got_object_id *id, int idx, const char *path)
+    struct got_object_id *id, int idx, const char *path)
 {
 	const struct got_error *err = NULL;
 	struct ibuf *wbuf;
diff --git a/lib/reference.c b/lib/reference.c
index 6f10967..fde331d 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -447,7 +447,7 @@ done:
 
 const struct got_error *
 got_ref_open(struct got_reference **ref, struct got_repository *repo,
-   const char *refname, int lock)
+    const char *refname, int lock)
 {
 	const struct got_error *err = NULL;
 	char *path_refs = NULL;
diff --git a/lib/repository.c b/lib/repository.c
index deb44a1..aefced9 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -868,9 +868,9 @@ got_repo_map_path(char **in_repo_path, struct got_repository *repo,
 				 * Matched an on-disk path inside repository
 				 * database. Treat input as repository-relative.
 				 */
-				 free(path);
-				 path = canonpath;
-				 canonpath = NULL;
+				free(path);
+				path = canonpath;
+				canonpath = NULL;
 			} else {
 				char *child;
 				/* Strip common prefix with repository path. */
@@ -886,9 +886,9 @@ got_repo_map_path(char **in_repo_path, struct got_repository *repo,
 			 * Matched unrelated on-disk path.
 			 * Treat input as repository-relative.
 			 */
-			 free(path);
-			 path = canonpath;
-			 canonpath = NULL;
+			free(path);
+			path = canonpath;
+			canonpath = NULL;
 		}
 	}
 
diff --git a/lib/repository_admin.c b/lib/repository_admin.c
index cf1fd8a..865369e 100644
--- a/lib/repository_admin.c
+++ b/lib/repository_admin.c
@@ -172,8 +172,8 @@ got_repo_pack_objects(FILE **packfile, struct got_object_id **pack_hash,
 	packfd = -1;
 
 	err = get_reflist_object_ids(&ours, &nours,
-	   (1 << GOT_OBJ_TYPE_COMMIT) | (1 << GOT_OBJ_TYPE_TAG),
-	   include_refs, repo, cancel_cb, cancel_arg);
+	    (1 << GOT_OBJ_TYPE_COMMIT) | (1 << GOT_OBJ_TYPE_TAG),
+	    include_refs, repo, cancel_cb, cancel_arg);
 	if (err)
 		goto done;
 
@@ -184,9 +184,9 @@ got_repo_pack_objects(FILE **packfile, struct got_object_id **pack_hash,
 
 	if (!TAILQ_EMPTY(exclude_refs)) {
 		err = get_reflist_object_ids(&theirs, &ntheirs,
-		   (1 << GOT_OBJ_TYPE_COMMIT) | (1 << GOT_OBJ_TYPE_TAG),
-		   exclude_refs, repo,
-		   cancel_cb, cancel_arg);
+		    (1 << GOT_OBJ_TYPE_COMMIT) | (1 << GOT_OBJ_TYPE_TAG),
+		    exclude_refs, repo,
+		    cancel_cb, cancel_arg);
 		if (err)
 			goto done;
 	}
@@ -450,29 +450,29 @@ got_repo_find_pack(FILE **packfile, struct got_object_id **pack_hash,
 
 	if (strncmp(p, "pack-", 5) != 0) {
 		err = got_error_fmt(GOT_ERR_BAD_PATH,
-		   "'%s' is not a valid pack file name",
-		   packfile_name);
+		    "'%s' is not a valid pack file name",
+		    packfile_name);
 		goto done;
 	}
 	p += 5;
 	dot = strchr(p, '.');
 	if (dot == NULL) {
 		err = got_error_fmt(GOT_ERR_BAD_PATH,
-		   "'%s' is not a valid pack file name",
-		   packfile_name);
+		    "'%s' is not a valid pack file name",
+		    packfile_name);
 		goto done;
 	}
 	if (strcmp(dot + 1, "pack") != 0) {
 		err = got_error_fmt(GOT_ERR_BAD_PATH,
-		   "'%s' is not a valid pack file name",
-		   packfile_name);
+		    "'%s' is not a valid pack file name",
+		    packfile_name);
 		goto done;
 	}
 	*dot = '\0';
 	if (!got_parse_sha1_digest(id.sha1, p)) {
 		err = got_error_fmt(GOT_ERR_BAD_PATH,
-		   "'%s' is not a valid pack file name",
-		   packfile_name);
+		    "'%s' is not a valid pack file name",
+		    packfile_name);
 		goto done;
 	}
 
@@ -736,8 +736,8 @@ preserve_loose_object(struct got_object_idset *loose_ids,
 	 * we do in fact have a valid packed copy of the object. Otherwise
 	 * we should not delete the loose representation of this object.
 	 */
-	 err = got_object_open_packed(&obj, id, repo);
-	 if (err == NULL) {
+	err = got_object_open_packed(&obj, id, repo);
+	if (err == NULL) {
 		got_object_close(obj);
 		/*
 		 * The object is referenced and packed.
diff --git a/lib/worktree.c b/lib/worktree.c
index 43f9d95..e8baa2a 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2497,8 +2497,8 @@ bump_base_commit_id(void *arg, struct got_fileindex_entry *ie)
 
 static const struct got_error *
 bump_base_commit_id_everywhere(struct got_worktree *worktree,
-     struct got_fileindex *fileindex,
-     got_worktree_checkout_cb progress_cb, void *progress_arg)
+    struct got_fileindex *fileindex,
+    got_worktree_checkout_cb progress_cb, void *progress_arg)
 {
 	struct bump_base_commit_id_arg bbc_arg;
 
@@ -3123,11 +3123,11 @@ check_mixed_commits(void *arg, struct got_fileindex_entry *ie)
 {
 	struct got_worktree *worktree = arg;
 
- 	/* Reject merges into a work tree with mixed base commits. */
- 	if (got_fileindex_entry_has_commit(ie) &&
+	/* Reject merges into a work tree with mixed base commits. */
+	if (got_fileindex_entry_has_commit(ie) &&
 	    memcmp(ie->commit_sha1, worktree->base_commit_id->sha1,
 	    SHA1_DIGEST_LENGTH) != 0)
- 		return got_error(GOT_ERR_MIXED_COMMITS);
+		return got_error(GOT_ERR_MIXED_COMMITS);
 
 	return NULL;
 }
@@ -4252,7 +4252,7 @@ static const struct got_error *
 copy_change(FILE *f1, FILE *f2, int *line_cur1, int *line_cur2,
     int start_old, int end_old, int start_new, int end_new,
     FILE *outfile, FILE *rejectfile)
- {
+{
 	const struct got_error *err;
 
 	/* Copy old file's lines leading up to patch. */
@@ -6713,7 +6713,7 @@ const struct got_error *
 got_worktree_rebase_abort(struct got_worktree *worktree,
     struct got_fileindex *fileindex, struct got_repository *repo,
     struct got_reference *new_base_branch,
-     got_worktree_checkout_cb progress_cb, void *progress_arg)
+    got_worktree_checkout_cb progress_cb, void *progress_arg)
 {
 	const struct got_error *err, *unlockerr, *sync_err;
 	struct got_reference *resolved = NULL;
diff --git a/libexec/got-read-gotconfig/parse.y b/libexec/got-read-gotconfig/parse.y
index 13c0d95..6c97b60 100644
--- a/libexec/got-read-gotconfig/parse.y
+++ b/libexec/got-read-gotconfig/parse.y
@@ -189,16 +189,16 @@ ref_list	: xref optnl			{ $$ = $1; }
 		}
 		;
 remoteopts2	: remoteopts2 remoteopts1 nl
-	   	| remoteopts1 optnl
+		| remoteopts1 optnl
 		;
 remoteopts1	: REPOSITORY STRING {
-	   		remote->repository = $2;
-	   	}
-	   	| SERVER STRING {
-	   		remote->server = $2;
+			remote->repository = $2;
+		}
+		| SERVER STRING {
+			remote->server = $2;
 		}
 		| PROTOCOL STRING {
-	   		remote->protocol = $2;
+			remote->protocol = $2;
 		}
 		| MIRROR_REFERENCES boolean {
 			remote->mirror_references = $2;
@@ -241,21 +241,21 @@ remoteopts1	: REPOSITORY STRING {
 				YYERROR;
 			}
 		} '{' optnl sendempty '}'
-	   	;
+		;
 fetchempty	: /* empty */
 		| fetchopts2
 		;
 fetchopts2	: fetchopts2 fetchopts1 nl
-	   	| fetchopts1 optnl
+		| fetchopts1 optnl
 		;
 fetchopts1	: REPOSITORY STRING {
-	   		remote->fetch_config->repository = $2;
-	   	}
-	   	| SERVER STRING {
-	   		remote->fetch_config->server = $2;
+			remote->fetch_config->repository = $2;
+		}
+		| SERVER STRING {
+			remote->fetch_config->server = $2;
 		}
 		| PROTOCOL STRING {
-	   		remote->fetch_config->protocol = $2;
+			remote->fetch_config->protocol = $2;
 		}
 		| PORT portplain {
 			remote->fetch_config->port = $2;
@@ -263,21 +263,21 @@ fetchopts1	: REPOSITORY STRING {
 		| BRANCH branch {
 			remote->fetch_config->branch = $2;
 		}
-	   	;
+		;
 sendempty	: /* empty */
 		| sendopts2
 		;
 sendopts2	: sendopts2 sendopts1 nl
-	   	| sendopts1 optnl
+		| sendopts1 optnl
 		;
 sendopts1	: REPOSITORY STRING {
-	   		remote->send_config->repository = $2;
-	   	}
-	   	| SERVER STRING {
-	   		remote->send_config->server = $2;
+			remote->send_config->repository = $2;
+		}
+		| SERVER STRING {
+			remote->send_config->server = $2;
 		}
 		| PROTOCOL STRING {
-	   		remote->send_config->protocol = $2;
+			remote->send_config->protocol = $2;
 		}
 		| PORT portplain {
 			remote->send_config->port = $2;
@@ -285,7 +285,7 @@ sendopts1	: REPOSITORY STRING {
 		| BRANCH branch {
 			remote->send_config->branch = $2;
 		}
-	   	;
+		;
 remote		: REMOTE STRING {
 			static const struct got_error* error;
 
@@ -302,7 +302,7 @@ remote		: REMOTE STRING {
 		}
 		;
 author		: AUTHOR STRING {
-	   		gotconfig.author = $2;
+			gotconfig.author = $2;
 		}
 		;
 optnl		: '\n' optnl
diff --git a/libexec/got-send-pack/got-send-pack.c b/libexec/got-send-pack/got-send-pack.c
index fc22714..ac6ef5c 100644
--- a/libexec/got-send-pack/got-send-pack.c
+++ b/libexec/got-send-pack/got-send-pack.c
@@ -541,7 +541,7 @@ send_pack(int fd, struct got_pathlist_head *refs,
 			goto done;
 		} else if (strncmp(buf, "ok ", 3) == 0) {
 			err = send_ref_status(ibuf, buf + 3, 1,
-			   refs, delete_refs);
+			    refs, delete_refs);
 			if (err)
 				goto done;
 		} else if (strncmp(buf, "ng ", 3) == 0) {