From 704be815c7f19d29faa7478cad0dd5847850027b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 Apr 2020 07:28:51 +0200 Subject: shellrc.d/git: do not remove root directory with gitbmerge --- shellrc.d/git | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shellrc.d/git') diff --git a/shellrc.d/git b/shellrc.d/git index 1c1de0a..a662cb0 100644 --- a/shellrc.d/git +++ b/shellrc.d/git @@ -19,6 +19,10 @@ gitbmerge() ( local wt wt="$(_gitbworktree "$1")" if [ -n "$wt" ]; then + if [ -d "$wd/.git" ]; then + echo "Branch is checked out in root repository!" + return 1 + fi rm -r "$wt" git worktree prune fi -- cgit v1.2.3