From d7d80d8b9370f2a16bba04429de4a74974d87b2e Mon Sep 17 00:00:00 2001 From: sloane <1699281+sloanelybutsurely@users.noreply.github.com> Date: Fri, 15 Mar 2024 15:04:16 -0400 Subject: [PATCH] prevent calling worktree instead of git-worktree by accident --- .config/fish/functions/worktree.fish | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.config/fish/functions/worktree.fish b/.config/fish/functions/worktree.fish index cba2e2a..0466c0e 100644 --- a/.config/fish/functions/worktree.fish +++ b/.config/fish/functions/worktree.fish @@ -1,7 +1,14 @@ # inspired heavily by https://github.com/llimllib/personal_code/blob/daab9eb1da9f777df57c742e5629247a94b54947/homedir/.local/bin/worktree function worktree + set worktree_commands add list lock move prune remove repair unlock set branchname $argv[1] + + if contains $branchname $worktree_commands + echo "did you mean `git worktree $branchname`?" + return 1 + end + set dirname (string replace -a "/" "_" $branchname) if not git pull