(path, remote string)
| 560 | } |
| 561 | |
| 562 | func (h *Helper) HandleRepoTransfer(path, remote string) error { |
| 563 | // clear cache |
| 564 | h.gitHelperMu.Lock() |
| 565 | h.gitHelper = nil |
| 566 | h.gitHelperMu.Unlock() |
| 567 | |
| 568 | // remove rill managed remote |
| 569 | err := removeRemote(path, "__rill_remote") |
| 570 | if err != nil { |
| 571 | return err |
| 572 | } |
| 573 | |
| 574 | // set origin to remote |
| 575 | err = gitutil.SetRemote(path, &gitutil.Config{ |
| 576 | Remote: remote, |
| 577 | }) |
| 578 | if err != nil { |
| 579 | return err |
| 580 | } |
| 581 | |
| 582 | return nil |
| 583 | } |
| 584 | |
| 585 | // CommitAndSafePush commits changes and safely pushes them to the remote repository. |
| 586 | // It fetches the latest remote changes, checks for conflicts, and handles them based on defaultPushChoice: |
no test coverage detected