Commit 8994de28866d144bef48299e4b6ae87a8927f4bc

Stefan Sperling 2019-02-05T18:22:18

fix got_worktree_open() error check in cmd_tree()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index 9363f9a..2d73aec 100644
--- a/got/got.c
+++ b/got/got.c
@@ -1307,7 +1307,7 @@ cmd_tree(int argc, char *argv[])
 	}
 	if (repo_path == NULL) {
 		error = got_worktree_open(&worktree, cwd);
-		if (error && (error->code != GOT_ERR_ERRNO && errno != ENOENT))
+		if (error && error->code != GOT_ERR_NOT_WORKTREE)
 			goto done;
 		else
 			error = NULL;