MCPcopy
hub / github.com/git-lfs/git-lfs / currentRefToMigrate

Function currentRefToMigrate

commands/command_migrate.go:313–325  ·  view source on GitHub ↗

currentRefToMigrate returns the fully-qualified name of the currently checked-out reference, or an error if the reference's type was not a local branch.

()

Source from the content-addressed store, hash-verified

311// checked-out reference, or an error if the reference's type was not a local
312// branch.
313func currentRefToMigrate() (*git.Ref, error) {
314 current, err := git.CurrentRef()
315 if err != nil {
316 return nil, err
317 }
318
319 if current.Type == git.RefTypeOther ||
320 current.Type == git.RefTypeRemoteBranch {
321
322 return nil, errors.New(tr.Tr.Get("Cannot migrate non-local ref: %s", current.Name))
323 }
324 return current, nil
325}
326
327// getHistoryRewriter returns a history rewriter that includes the filepath
328// filter given by the --include and --exclude arguments.

Callers 1

includeExcludeRefsFunction · 0.85

Calls 3

CurrentRefFunction · 0.92
NewFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected