Setup git repo on settings change

This commit is contained in:
2024-10-13 11:16:44 +02:00
parent aad6616ebe
commit ac54c083a9
4 changed files with 36 additions and 10 deletions

View File

@@ -42,6 +42,15 @@ func New(rootDir string, settings *models.Settings) *FileSystem {
return fs
}
func (fs *FileSystem) SetupGitRepo(gitURL string, gitUser string, gitToken string) error {
fs.GitRepo = gitutils.New(gitURL, gitUser, gitToken, fs.RootDir)
return fs.InitializeGitRepo()
}
func (fs *FileSystem) DisableGitRepo() {
fs.GitRepo = nil;
}
func (fs *FileSystem) InitializeGitRepo() error {
if fs.GitRepo == nil {
return errors.New("git settings not configured")