commit 13bfb272d51b1b7cf8f81e858928fb9af4698883 from: joshua stein date: Fri May 10 22:47:33 2019 UTC got: remove trailing slash from worktree_path avoids a double slash when building a path in got_worktree_init commit - 18779d584bc200d66f35a96ea49cf38cce6678f5 commit + 13bfb272d51b1b7cf8f81e858928fb9af4698883 blob - c82e0bfd137ee751f13b1a609bfe0391b7593e5f blob + d699079b48ca83e9cf1d07754bd3915623367023 --- got/got.c +++ got/got.c @@ -314,7 +314,7 @@ cmd_checkout(int argc, char *argv[]) char *worktree_path = NULL; const char *path_prefix = ""; char *commit_id_str = NULL; - int ch, same_path_prefix; + int ch, same_path_prefix, x; while ((ch = getopt(argc, argv, "c:p:")) != -1) { switch (ch) { @@ -381,6 +381,9 @@ cmd_checkout(int argc, char *argv[]) } else usage_checkout(); + if (worktree_path[x = strlen(worktree_path) - 1] == '/') + worktree_path[x] = '\0'; + error = got_repo_open(&repo, repo_path); if (error != NULL) goto done;