aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2020-04-24 07:28:51 +0200
committerKarel Kočí <cynerd@email.cz>2020-04-24 07:28:51 +0200
commit704be815c7f19d29faa7478cad0dd5847850027b (patch)
treefe08fe7354b26ce6d3f21475ef51049fc1279d9e
parente0949a2d329b434999fdb285c2461ad880c7f337 (diff)
downloadshellrc-0.7.6.tar.gz
shellrc-0.7.6.tar.bz2
shellrc-0.7.6.zip
shellrc.d/git: do not remove root directory with gitbmergev0.7.6
-rw-r--r--shellrc.d/git4
1 files changed, 4 insertions, 0 deletions
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