Commit 384417cbfe7fa5168e4ed18dcfd233ddddf94ac4

Stefan Sperling 2019-05-11T09:00:57

strip all trailing slashes from work tree path, not just first one

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/got/got.c b/got/got.c
index d699079..d478002 100644
--- a/got/got.c
+++ b/got/got.c
@@ -381,7 +381,7 @@ cmd_checkout(int argc, char *argv[])
 	} else
 		usage_checkout();
 
-	if (worktree_path[x = strlen(worktree_path) - 1] == '/')
+	while (worktree_path[x = strlen(worktree_path) - 1] == '/')
 		worktree_path[x] = '\0';
 
 	error = got_repo_open(&repo, repo_path);