MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / PersistAuthFiles

Method PersistAuthFiles

internal/store/gitstore.go:419–450  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
419func (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
452func (s *GitTokenStore) resolveDeletePath(id string) (string, error) {
453 if strings.ContainsRune(id, os.PathSeparator) || filepath.IsAbs(id) {

Callers

nothing calls this directly

Calls 3

EnsureRepositoryMethod · 0.95
relativeToRepoMethod · 0.95
commitAndPushLockedMethod · 0.95

Tested by

no test coverage detected