prevent calling worktree instead of git-worktree by accident

This commit is contained in:
sloane 2024-03-15 15:04:16 -04:00
parent dc9b95dbb3
commit d7d80d8b93
No known key found for this signature in database

View file

@ -1,7 +1,14 @@
# inspired heavily by https://github.com/llimllib/personal_code/blob/daab9eb1da9f777df57c742e5629247a94b54947/homedir/.local/bin/worktree # inspired heavily by https://github.com/llimllib/personal_code/blob/daab9eb1da9f777df57c742e5629247a94b54947/homedir/.local/bin/worktree
function worktree function worktree
set worktree_commands add list lock move prune remove repair unlock
set branchname $argv[1] 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) set dirname (string replace -a "/" "_" $branchname)
if not git pull if not git pull