Commit 6962eb72119c221eca83da6b7b3bd76f730d6898

Stefan Sperling 2020-02-20T15:11:59

unify formatting of common code in tog log, blame, and tree

diff --git a/tog/tog.c b/tog/tog.c
index 71e5672..9e80090 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2592,18 +2592,17 @@ cmd_log(int argc, char *argv[])
 		usage_log();
 
 	cwd = getcwd(NULL, 0);
-	if (cwd == NULL) {
-		error = got_error_from_errno("getcwd");
-		goto done;
-	}
+	if (cwd == NULL)
+		return got_error_from_errno("getcwd");
+
 	error = got_worktree_open(&worktree, cwd);
 	if (error && error->code != GOT_ERR_NOT_WORKTREE)
 		goto done;
 
 	if (repo_path == NULL) {
 		if (worktree)
-			repo_path = strdup(
-			    got_worktree_get_repo_path(worktree));
+			repo_path =
+			    strdup(got_worktree_get_repo_path(worktree));
 		else
 			repo_path = strdup(cwd);
 	}
@@ -4398,10 +4397,9 @@ cmd_blame(int argc, char *argv[])
 		usage_blame();
 
 	cwd = getcwd(NULL, 0);
-	if (cwd == NULL) {
-		error = got_error_from_errno("getcwd");
-		goto done;
-	}
+	if (cwd == NULL)
+		return got_error_from_errno("getcwd");
+
 	error = got_worktree_open(&worktree, cwd);
 	if (error && error->code != GOT_ERR_NOT_WORKTREE)
 		goto done;