summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2024-05-10 02:00:55 +0200
committerLouis Burda <quent.burda@gmail.com>2024-05-10 02:00:55 +0200
commitf29303942ad96989f88f4a91be0f1d60b38f42e6 (patch)
treebe55a9e82c0f0b1c619b0969f9deac08da3b60a0
parent386f01da2126f80ec1db85430da27d595a466a5f (diff)
downloadsubgit-f29303942ad96989f88f4a91be0f1d60b38f42e6.tar.gz
subgit-f29303942ad96989f88f4a91be0f1d60b38f42e6.zip
Remove existing subgit on clone
-rwxr-xr-xsubgit-clone1
1 files changed, 1 insertions, 0 deletions
diff --git a/subgit-clone b/subgit-clone
index ac3c267..c6b62a2 100755
--- a/subgit-clone
+++ b/subgit-clone
@@ -22,6 +22,7 @@ git clone "$@"
[ ! -e "$repo/$subrepo" ] && die "Subrepo $subrepo missing"
mkdir -p $(dirname "$repo/.subgit/$subrepo")
+rm -rf "$repo/.subgit/$subrepo"
mv "$repo/$subrepo/.git" "$repo/.subgit/$subrepo"
subgit[$subrepo]=1