Skip to content

Commit

Permalink
git: refs
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Aug 17, 2024
1 parent 257f9d0 commit be6c058
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
19 changes: 19 additions & 0 deletions completers/git_completer/cmd/refs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var refsCmd = &cobra.Command{
Use: "refs",
Short: "Low-level access to refs",
Run: func(cmd *cobra.Command, args []string) {},
GroupID: groups[group_manipulator].ID,
}

func init() {
carapace.Gen(refsCmd).Standalone()

rootCmd.AddCommand(refsCmd)
}
27 changes: 27 additions & 0 deletions completers/git_completer/cmd/refs_migrate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"github.com/carapace-sh/carapace"
"github.com/spf13/cobra"
)

var refs_migrateCmd = &cobra.Command{
Use: "migrate",
Short: "Migrate ref store between different formats",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(refs_migrateCmd).Standalone()

refs_migrateCmd.Flags().Bool("dry-run", false, "perform the migration, but do not modify the repository")
refs_migrateCmd.Flags().String("ref-format", "", "the ref format to migrate the ref store to")
refsCmd.AddCommand(refs_migrateCmd)

carapace.Gen(refs_migrateCmd).FlagCompletion(carapace.ActionMap{
"ref-format": carapace.ActionValuesDescribed(
"files", "loose files with packed-refs",
"reftable", "reftable format",
),
})
}

0 comments on commit be6c058

Please sign in to comment.