diff --git a/docs/nu-git-manager/gm-clean.md b/docs/nu-git-manager/gm-clean.md index c044af3..55d3874 100644 --- a/docs/nu-git-manager/gm-clean.md +++ b/docs/nu-git-manager/gm-clean.md @@ -1,4 +1,4 @@ -# `gm clean` from `nu-git-manager` (see [source](https://github.com/amtoine/nu-git-manager/blob/main/pkgs/nu-git-manager/nu-git-manager/mod.nu#L560)) +# `gm clean` from `nu-git-manager` (see [source](https://github.com/amtoine/nu-git-manager/blob/main/pkgs/nu-git-manager/nu-git-manager/mod.nu#L567)) clean the store this command will mainly remove empty directory recursively. diff --git a/docs/nu-git-manager/gm-squash-forks.md b/docs/nu-git-manager/gm-squash-forks.md index eda7719..c14e496 100644 --- a/docs/nu-git-manager/gm-squash-forks.md +++ b/docs/nu-git-manager/gm-squash-forks.md @@ -1,4 +1,4 @@ -# `gm squash-forks` from `nu-git-manager` (see [source](https://github.com/amtoine/nu-git-manager/blob/main/pkgs/nu-git-manager/nu-git-manager/mod.nu#L483)) +# `gm squash-forks` from `nu-git-manager` (see [source](https://github.com/amtoine/nu-git-manager/blob/main/pkgs/nu-git-manager/nu-git-manager/mod.nu#L490)) squash multi-directory forks into a single repo Here, two forks are defined as *two non-grafted repositories that share the same initial commit, diff --git a/pkgs/nu-git-manager/nu-git-manager/mod.nu b/pkgs/nu-git-manager/nu-git-manager/mod.nu index 728ab9f..12fecb3 100644 --- a/pkgs/nu-git-manager/nu-git-manager/mod.nu +++ b/pkgs/nu-git-manager/nu-git-manager/mod.nu @@ -431,6 +431,13 @@ export def "gm remove" [ let repo_to_remove = $root | path join $repo_to_remove + # FIXME: this should be possible with `path relative-to` + # related to https://github.com/nushell/nushell/issues/10370 + if (pwd | path expand | str starts-with $repo_to_remove) { + log error "cannot remove the repo because you are inside it" + return + } + rm --recursive --force --verbose $repo_to_remove let cache_file = get-repo-store-cache-path