Commit 62d463cac1fd99c423acb07c0367c649724a2a9a

Christian Weisgerber 2020-10-20T22:43:59

indentation fixes

diff --git a/got/got.c b/got/got.c
index 138291e..f7f14b9 100644
--- a/got/got.c
+++ b/got/got.c
@@ -191,8 +191,8 @@ main(int argc, char *argv[])
 	int ch;
 	int hflag = 0, Vflag = 0;
 	static struct option longopts[] = {
-	     { "version", no_argument, NULL, 'V' },
-	     { NULL, 0, NULL, 0 }
+	    { "version", no_argument, NULL, 'V' },
+	    { NULL, 0, NULL, 0 }
 	};
 
 	setlocale(LC_CTYPE, "");
@@ -561,7 +561,7 @@ collect_import_msg(char **logmsg, char **logmsg_path, const char *editor,
 	}
 
 	err = edit_logmsg(logmsg, editor, *logmsg_path, initial_content,
-	     initial_content_len);
+	    initial_content_len);
 done:
 	if (fd != -1 && close(fd) == -1 && err == NULL)
 		err = got_error_from_errno2("close", *logmsg_path);
@@ -957,13 +957,13 @@ fetch_progress(void *arg, const char *message, off_t packfile_size,
 	if (a->create_configs && !a->configs_created &&
 	    !TAILQ_EMPTY(a->config_info.symrefs)) {
 		err = create_config_files(a->config_info.proto,
-		     a->config_info.host, a->config_info.port,
-		     a->config_info.remote_repo_path,
-		     a->config_info.git_url,
-		     a->config_info.fetch_all_branches,
-		     a->config_info.mirror_references,
-		     a->config_info.symrefs,
-		     a->config_info.wanted_branches, a->repo);
+		    a->config_info.host, a->config_info.port,
+		    a->config_info.remote_repo_path,
+		    a->config_info.git_url,
+		    a->config_info.fetch_all_branches,
+		    a->config_info.mirror_references,
+		    a->config_info.symrefs,
+		    a->config_info.wanted_branches, a->repo);
 		if (err)
 			return err;
 		a->configs_created = 1;
@@ -1296,7 +1296,7 @@ create_config_files(const char *proto, const char *host, const char *port,
 	 * If we asked for a set of wanted branches then use the first
 	 * one of those.
 	 */
-	 if (!TAILQ_EMPTY(wanted_branches)) {
+	if (!TAILQ_EMPTY(wanted_branches)) {
 		pe = TAILQ_FIRST(wanted_branches);
 		default_branch = pe->path;
 	} else {
@@ -1637,7 +1637,7 @@ cmd_clone(int argc, char *argv[])
 		 * a set of wanted branches use the first of one of those
 		 * which could be fetched instead.
 		 */
-		 TAILQ_FOREACH(pe, &wanted_branches, entry) {
+		TAILQ_FOREACH(pe, &wanted_branches, entry) {
 			const char *target = pe->path;
 			struct got_reference *target_ref;
 
@@ -5486,8 +5486,8 @@ add_branch(struct got_repository *repo, const char *branch_name,
 		return got_error_path(branch_name, GOT_ERR_REF_NAME_MINUS);
 
 	if (asprintf(&refname, "refs/heads/%s", branch_name) == -1) {
-		 err = got_error_from_errno("asprintf");
-		 goto done;
+		err = got_error_from_errno("asprintf");
+		goto done;
 	}
 
 	err = got_ref_open(&ref, repo, refname, 0);
@@ -5974,13 +5974,13 @@ add_tag(struct got_repository *repo, struct got_worktree *worktree,
 	if (strncmp("refs/tags/", tag_name, 10) == 0) {
 		refname = strdup(tag_name);
 		if (refname == NULL) {
-			 err = got_error_from_errno("strdup");
-			 goto done;
+			err = got_error_from_errno("strdup");
+			goto done;
 		}
 		tag_name += 10;
 	} else if (asprintf(&refname, "refs/tags/%s", tag_name) == -1) {
-		 err = got_error_from_errno("asprintf");
-		 goto done;
+		err = got_error_from_errno("asprintf");
+		goto done;
 	}
 
 	err = got_ref_open(&ref, repo, refname, 0);
@@ -6288,7 +6288,7 @@ cmd_add(int argc, char *argv[])
 		TAILQ_FOREACH(pe, &paths, entry) {
 			if (asprintf(&ondisk_path, "%s/%s",
 			    got_worktree_get_root_path(worktree),
-			       pe->path) == -1) {
+			    pe->path) == -1) {
 				error = got_error_from_errno("asprintf");
 				goto done;
 			}
@@ -6436,7 +6436,7 @@ cmd_remove(int argc, char *argv[])
 		TAILQ_FOREACH(pe, &paths, entry) {
 			if (asprintf(&ondisk_path, "%s/%s",
 			    got_worktree_get_root_path(worktree),
-			       pe->path) == -1) {
+			    pe->path) == -1) {
 				error = got_error_from_errno("asprintf");
 				goto done;
 			}
@@ -6693,7 +6693,7 @@ cmd_revert(int argc, char *argv[])
 		TAILQ_FOREACH(pe, &paths, entry) {
 			if (asprintf(&ondisk_path, "%s/%s",
 			    got_worktree_get_root_path(worktree),
-			       pe->path) == -1) {
+			    pe->path) == -1) {
 				error = got_error_from_errno("asprintf");
 				goto done;
 			}
@@ -8868,7 +8868,7 @@ cmd_histedit(int argc, char *argv[])
 			if (hle->cmd->code == GOT_HISTEDIT_DROP ||
 			    hle->cmd->code == GOT_HISTEDIT_FOLD) {
 				error = histedit_skip_commit(hle, worktree,
-				   repo);
+				    repo);
 				if (error)
 					goto done;
 			} else {
diff --git a/gotweb/gotweb.c b/gotweb/gotweb.c
index 6ea20ef..9dedeb9 100644
--- a/gotweb/gotweb.c
+++ b/gotweb/gotweb.c
@@ -1497,7 +1497,7 @@ gw_summary(struct gw_trans *gw_trans)
 		if (kerr != KCGI_OK)
 			goto done;
 		kerr = khtml_puts(gw_trans->gw_html_req,
-		     gw_trans->gw_dir->owner);
+		    gw_trans->gw_dir->owner);
 		if (kerr != KCGI_OK)
 			goto done;
 		kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
@@ -2199,7 +2199,7 @@ gw_template(size_t key, void *arg)
 	    "/apple-touch-icon.png") == -1)
 		goto err;
 	if (asprintf(&fic32, "%s%s", gw_trans->gw_conf->got_www_path,
-	     "/favicon-32x32.png") == -1)
+	    "/favicon-32x32.png") == -1)
 		goto err;
 	if (asprintf(&fic16, "%s%s", gw_trans->gw_conf->got_www_path,
 	    "/favicon-16x16.png") == -1)
@@ -4588,7 +4588,7 @@ gw_output_site_link(struct gw_trans *gw_trans)
 	if (kerr != KCGI_OK)
 		goto done;
 	kerr = khtml_puts(gw_trans->gw_html_req,
-	   gw_trans->gw_conf->got_site_link);
+	    gw_trans->gw_conf->got_site_link);
 	if (kerr != KCGI_OK)
 		goto done;
 	kerr = khtml_closeelem(gw_trans->gw_html_req, 1);
diff --git a/lib/blame.c b/lib/blame.c
index 4213eec..f8f1b5e 100644
--- a/lib/blame.c
+++ b/lib/blame.c
@@ -223,7 +223,7 @@ blame_open(struct got_blame **blamep, const char *path,
 		goto done;
 	}
 	err = got_object_blob_dump_to_file(&blame->filesize, &blame->nlines,
-	   &blame->line_offsets, blame->f, blob);
+	    &blame->line_offsets, blame->f, blob);
 	if (err || blame->nlines == 0)
 		goto done;
 
diff --git a/lib/inflate.c b/lib/inflate.c
index b6bb904..1197bbb 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -296,7 +296,7 @@ got_inflate_to_mem(uint8_t **outbuf, size_t *outlen,
 				continue;
 			zb.outlen = (nbuf * GOT_INFLATE_BUFSIZE) - *outlen;
 			newbuf = reallocarray(*outbuf, ++nbuf,
-			   GOT_INFLATE_BUFSIZE);
+			    GOT_INFLATE_BUFSIZE);
 			if (newbuf == NULL) {
 				err = got_error_from_errno("reallocarray");
 				free(*outbuf);
diff --git a/lib/privsep.c b/lib/privsep.c
index 0cacbdd..d15fdd1 100644
--- a/lib/privsep.c
+++ b/lib/privsep.c
@@ -500,7 +500,7 @@ got_privsep_send_fetch_req(struct imsgbuf *ibuf, int fd,
 		    len);
 		if (wbuf == NULL)
 			return got_error_from_errno(
-			     "imsg_create FETCH_WANTED_BRANCH");
+			    "imsg_create FETCH_WANTED_BRANCH");
 
 		/* Keep in sync with struct got_imsg_fetch_wanted_branch! */
 		if (imsg_add(wbuf, &name_len, sizeof(name_len)) == -1) {
@@ -511,7 +511,7 @@ got_privsep_send_fetch_req(struct imsgbuf *ibuf, int fd,
 		}
 		if (imsg_add(wbuf, name, name_len) == -1) {
 			err = got_error_from_errno(
-			     "imsg_add FETCH_WANTED_BRANCH");
+			    "imsg_add FETCH_WANTED_BRANCH");
 			ibuf_free(wbuf);
 			return err;
 		}
@@ -532,7 +532,7 @@ got_privsep_send_fetch_req(struct imsgbuf *ibuf, int fd,
 		    len);
 		if (wbuf == NULL)
 			return got_error_from_errno(
-			     "imsg_create FETCH_WANTED_REF");
+			    "imsg_create FETCH_WANTED_REF");
 
 		/* Keep in sync with struct got_imsg_fetch_wanted_ref! */
 		if (imsg_add(wbuf, &name_len, sizeof(name_len)) == -1) {
@@ -543,7 +543,7 @@ got_privsep_send_fetch_req(struct imsgbuf *ibuf, int fd,
 		}
 		if (imsg_add(wbuf, name, name_len) == -1) {
 			err = got_error_from_errno(
-			     "imsg_add FETCH_WANTED_REF");
+			    "imsg_add FETCH_WANTED_REF");
 			ibuf_free(wbuf);
 			return err;
 		}
@@ -1311,7 +1311,7 @@ got_privsep_send_blob(struct imsgbuf *ibuf, size_t size, size_t hdrlen,
 		memcpy(buf, &iblob, sizeof(iblob));
 		memcpy(buf + sizeof(iblob), data, size);
 		if (imsg_compose(ibuf, GOT_IMSG_BLOB, 0, 0, -1, buf,
-		   sizeof(iblob) + size) == -1) {
+		    sizeof(iblob) + size) == -1) {
 			free(buf);
 			return got_error_from_errno("imsg_compose BLOB");
 		}
diff --git a/lib/worktree.c b/lib/worktree.c
index 330247e..54a1c38 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -2445,9 +2445,9 @@ sync_fileindex(struct got_fileindex *fileindex, const char *fileindex_path)
 	 * this program exits have a different time stamp from the one which
 	 * was recorded in the file index.
 	 */
-	 timeout.tv_sec = 0;
-	 timeout.tv_nsec = 1;
-	 nanosleep(&timeout,  NULL);
+	timeout.tv_sec = 0;
+	timeout.tv_nsec = 1;
+	nanosleep(&timeout,  NULL);
 done:
 	if (new_index)
 		fclose(new_index);
@@ -2582,7 +2582,7 @@ checkout_files(struct got_worktree *worktree, struct got_fileindex *fileindex,
 	}
 
 	err = got_object_open_as_commit(&commit, repo,
-	   worktree->base_commit_id);
+	    worktree->base_commit_id);
 	if (err)
 		goto done;
 
@@ -4986,7 +4986,7 @@ match_modified_subtree(int *modified, struct got_tree_entry *te,
 		struct got_commitable *ct = pe->data;
 		*modified = got_path_is_child(ct->in_repo_path, te_path,
 		    strlen(te_path));
-		 if (*modified)
+		if (*modified)
 			break;
 	}
 
@@ -5023,8 +5023,8 @@ match_deleted_or_modified_ct(struct got_commitable **ctp,
 		if (got_object_id_cmp(ct->base_blob_id, &te->id) != 0)
 			continue;
 
-		 err = match_ct_parent_path(&path_matches, ct, base_tree_path);
-		 if (err)
+		err = match_ct_parent_path(&path_matches, ct, base_tree_path);
+		if (err)
 			return err;
 		if (!path_matches)
 			continue;
@@ -5116,8 +5116,8 @@ write_tree(struct got_object_id **new_tree_id, int *nentries,
 		    (ct->flags & GOT_COMMITABLE_ADDED))
 			continue;
 
-		 if (!got_path_is_child(ct->in_repo_path, path_base_tree,
-		     strlen(path_base_tree)))
+		if (!got_path_is_child(ct->in_repo_path, path_base_tree,
+		    strlen(path_base_tree)))
 			continue;
 
 		err = got_path_skip_common_ancestor(&child_path, path_base_tree,
diff --git a/libexec/got-fetch-pack/got-fetch-pack.c b/libexec/got-fetch-pack/got-fetch-pack.c
index 1a5b3d0..90f2ff6 100644
--- a/libexec/got-fetch-pack/got-fetch-pack.c
+++ b/libexec/got-fetch-pack/got-fetch-pack.c
@@ -82,8 +82,8 @@ flushpkt(int fd)
 	if (chattygot > 1)
 		fprintf(stderr, "%s: writepkt: 0000\n", getprogname());
 
-	 w = write(fd, "0000", 4);
-	 if (w == -1)
+	w = write(fd, "0000", 4);
+	if (w == -1)
 		return got_error_from_errno("write");
 	if (w != 4)
 		return got_error(GOT_ERR_IO);
@@ -844,7 +844,7 @@ fetch_pack(int fd, int packfd, uint8_t *pack_sha1,
 			continue;
 		got_sha1_digest_to_str(want[i].sha1, hashstr, sizeof(hashstr));
 		n = snprintf(buf, sizeof(buf), "want %s%s\n", hashstr,
-		   sent_my_capabilites ? "" : my_capabilities);
+		    sent_my_capabilites ? "" : my_capabilities);
 		if (n >= sizeof(buf)) {
 			err = got_error(GOT_ERR_NO_SPACE);
 			goto done;
diff --git a/libexec/got-read-pack/got-read-pack.c b/libexec/got-read-pack/got-read-pack.c
index 687ed2e..27d10ab 100644
--- a/libexec/got-read-pack/got-read-pack.c
+++ b/libexec/got-read-pack/got-read-pack.c
@@ -234,7 +234,7 @@ tree_request(struct imsg *imsg, struct imsgbuf *ibuf, struct got_pack *pack,
 	memcpy(id.sha1, iobj.id, SHA1_DIGEST_LENGTH);
 
 	err = open_tree(&buf, &entries, &nentries, pack, packidx, iobj.idx,
-	     &id, objcache);
+	    &id, objcache);
 	if (err)
 		return err;
 
@@ -990,15 +990,15 @@ main(int argc, char *argv[])
 			break;
 		case GOT_IMSG_TREE_REQUEST:
 			err = tree_request(&imsg, &ibuf, pack, packidx,
-			   &objcache);
+			    &objcache);
 			break;
 		case GOT_IMSG_BLOB_REQUEST:
 			err = blob_request(&imsg, &ibuf, pack, packidx,
-			   &objcache);
+			    &objcache);
 			break;
 		case GOT_IMSG_TAG_REQUEST:
 			err = tag_request(&imsg, &ibuf, pack, packidx,
-			   &objcache);
+			    &objcache);
 			break;
 		case GOT_IMSG_COMMIT_TRAVERSAL_REQUEST:
 			err = commit_traversal_request(&imsg, &ibuf, pack,
diff --git a/tog/tog.c b/tog/tog.c
index a0db9b1..1b0d1ec 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2249,8 +2249,8 @@ open_log_view(struct tog_view *view, struct got_object_id *start_id,
 	    !s->log_branches);
 	if (err)
 		goto done;
-	err = got_commit_graph_iter_start(thread_graph,
-	     s->start_id, s->repo, NULL, NULL);
+	err = got_commit_graph_iter_start(thread_graph, s->start_id,
+	    s->repo, NULL, NULL);
 	if (err)
 		goto done;
 
@@ -5636,8 +5636,8 @@ main(int argc, char *argv[])
 	int ch, hflag = 0, Vflag = 0;
 	char **cmd_argv = NULL;
 	static struct option longopts[] = {
-	     { "version", no_argument, NULL, 'V' },
-	     { NULL, 0, NULL, 0}
+	    { "version", no_argument, NULL, 'V' },
+	    { NULL, 0, NULL, 0}
 	};
 
 	setlocale(LC_CTYPE, "");