make "tog log" respect -r argument; from semarie@
diff --git a/tog/tog.c b/tog/tog.c
index f6655ba..0a56b3a 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -2229,8 +2229,12 @@ cmd_log(int argc, char *argv[])
} else
usage_log();
- repo_path = worktree ?
- strdup(got_worktree_get_repo_path(worktree)) : strdup(cwd);
+ if (repo_path == NULL) {
+ if (worktree)
+ repo_path = strdup(got_worktree_get_repo_path(worktree));
+ else
+ repo_path = strdup(cwd);
+ }
if (repo_path == NULL) {
error = got_error_from_errno("strdup");
goto done;