Skip to content

Commit

Permalink
Merge pull request #2511 from carapace-sh/git-refs
Browse files Browse the repository at this point in the history
git: refs
  • Loading branch information
rsteube authored Aug 17, 2024
2 parents bb651d4 + be6c058 commit a0d30b0
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 a0d30b0

Please sign in to comment.