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.
()
| 311 | // checked-out reference, or an error if the reference's type was not a local |
| 312 | // branch. |
| 313 | func 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. |
no test coverage detected