commit 6962eb72119c221eca83da6b7b3bd76f730d6898 from: Stefan Sperling date: Thu Feb 20 15:11:59 2020 UTC unify formatting of common code in tog log, blame, and tree commit - e4a0e26d952b5d39d33113b47ba98dca4f0e5539 commit + 6962eb72119c221eca83da6b7b3bd76f730d6898 blob - 71e5672490f2239c78f28248f04f04464ce7048f blob + 9e8009077b052e09ca9a672a6324e575c6116de3 --- tog/tog.c +++ 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;