Skip to content

Commit

Permalink
always commit
Browse files Browse the repository at this point in the history
  • Loading branch information
amtoine committed Dec 6, 2024
1 parent 628187e commit 91821f6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkgs/nu-git-manager/nu-git-manager/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,9 @@ export def "gm clone" [
^git clone ...$args

if (^git -C $local_path log | complete | get exit_code) != 0 {
print "it appears you have cloned an empty repository"
let res = ["yes", "no"] | input list --fuzzy "do you want to create an 'init' commit?"
if $res == "yes" {
^git -C $local_path commit --allow-empty
}
print $"it appears you have cloned an (ansi yellow_bold)empty repository(ansi reset)"
print $"creating an (ansi cyan)'init' commit(ansi reset)"
^git -C $local_path commit --allow-empty --message "init"
}

^git -C $local_path remote set-url $remote $urls.fetch
Expand Down

0 comments on commit 91821f6

Please sign in to comment.