From 99d0bc597cb5007697e66ccd7cde1647f8d2df38 Mon Sep 17 00:00:00 2001 From: Cristian Betivu Date: Mon, 29 Jan 2024 20:18:19 +0200 Subject: [PATCH] Address todo --- README.md | 1 - src/worktree.rs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89a79be..5341d62 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,6 @@ This command will be passed via `bash -c`, so you can use bash shenanigans if yo This is a work in progress tool, so it may be rough in some areas... - Figure out how to build and share the packaged version of the tool -- Split branch name by '/' and join parts to a Path (i.e. generate platform dependant dir name) - Pre-commit hook - Polish logging - Polish errors handling diff --git a/src/worktree.rs b/src/worktree.rs index 0b2a0b6..7dd00b3 100644 --- a/src/worktree.rs +++ b/src/worktree.rs @@ -81,7 +81,8 @@ fn new_worktree( worktree_add_options.reference(Some(new_branch.get())); let repo_root = get_root_path(repo)?; - let worktree_path = repo_root.join(branch_name); // TODO: Perhaps split by '/' and then join parts to path + // convert "/" to OS specific path separator + let worktree_path = repo_root.join(branch_name.split('/').collect::()); let parent_dir = worktree_path .parent()