commit 5486daa23d45c65288ff2db5e09ec14956d2922a from: Stefan Sperling date: Sat May 11 15:15:11 2019 UTC fix -r option of 'got log' commit - 48b8b0ebe312124b17b290c38f2bbd0b5fbc1338 commit + 5486daa23d45c65288ff2db5e09ec14956d2922a blob - e3fbc8bfcbcd998c0514a54e52eca9a9e1feb03d blob + 8c16ff6563b96b1d3bc5fbef53e15bb1228b1c3b --- got/got.c +++ got/got.c @@ -890,8 +890,10 @@ 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) { + repo_path = worktree ? + strdup(got_worktree_get_repo_path(worktree)) : strdup(cwd); + } if (repo_path == NULL) { error = got_error_from_errno(); goto done;