MCPcopy Create free account
hub / github.com/go-git/go-git / CheckoutOptions

Struct CheckoutOptions

options.go:348–367  ·  view source on GitHub ↗

CheckoutOptions describes how a checkout operation should be performed.

Source from the content-addressed store, hash-verified

346
347// CheckoutOptions describes how a checkout operation should be performed.
348type CheckoutOptions struct {
349 // Hash is the hash of a commit or tag to be checked out. If used, HEAD
350 // will be in detached mode. If Create is not used, Branch and Hash are
351 // mutually exclusive.
352 Hash plumbing.Hash
353 // Branch to be checked out, if Branch and Hash are empty is set to `master`.
354 Branch plumbing.ReferenceName
355 // Create a new branch named Branch and start it at Hash.
356 Create bool
357 // Force, if true when switching branches, proceed even if the index or the
358 // working tree differs from HEAD. This is used to throw away local changes
359 Force bool
360 // Keep, if true when switching branches, local changes (the index or the
361 // working tree changes) will be kept so that they can be committed to the
362 // target branch. Force and Keep are mutually exclusive, should not be both
363 // set to true.
364 Keep bool
365 // SparseCheckoutDirectories
366 SparseCheckoutDirectories []string
367}
368
369// Validate validates the fields and sets the default values.
370func (o *CheckoutOptions) Validate() error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected