PersistAuthFiles commits and pushes the provided paths to the remote repository. It no-ops when the store is not fully configured or when there are no paths.
(_ context.Context, message string, paths ...string)
| 417 | // PersistAuthFiles commits and pushes the provided paths to the remote repository. |
| 418 | // It no-ops when the store is not fully configured or when there are no paths. |
| 419 | func (s *GitTokenStore) PersistAuthFiles(_ context.Context, message string, paths ...string) error { |
| 420 | if len(paths) == 0 { |
| 421 | return nil |
| 422 | } |
| 423 | if err := s.EnsureRepository(); err != nil { |
| 424 | return err |
| 425 | } |
| 426 | |
| 427 | filtered := make([]string, 0, len(paths)) |
| 428 | for _, p := range paths { |
| 429 | trimmed := strings.TrimSpace(p) |
| 430 | if trimmed == "" { |
| 431 | continue |
| 432 | } |
| 433 | rel, err := s.relativeToRepo(trimmed) |
| 434 | if err != nil { |
| 435 | return err |
| 436 | } |
| 437 | filtered = append(filtered, rel) |
| 438 | } |
| 439 | if len(filtered) == 0 { |
| 440 | return nil |
| 441 | } |
| 442 | |
| 443 | s.mu.Lock() |
| 444 | defer s.mu.Unlock() |
| 445 | |
| 446 | if strings.TrimSpace(message) == "" { |
| 447 | message = "Sync watcher updates" |
| 448 | } |
| 449 | return s.commitAndPushLocked(message, filtered...) |
| 450 | } |
| 451 | |
| 452 | func (s *GitTokenStore) resolveDeletePath(id string) (string, error) { |
| 453 | if strings.ContainsRune(id, os.PathSeparator) || filepath.IsAbs(id) { |
nothing calls this directly
no test coverage detected