Commit a1fbf39a454ab02859425068e8840d29356ea511

Stefan Sperling 2019-08-11T20:22:30

make "tog log" respect -r argument; from semarie@

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;