aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/repository/adopt.go3
-rw-r--r--modules/repository/create.go6
-rw-r--r--modules/repository/fork.go8
-rw-r--r--modules/repository/generate.go11
-rw-r--r--modules/repository/repo.go15
5 files changed, 40 insertions, 3 deletions
diff --git a/modules/repository/adopt.go b/modules/repository/adopt.go
index c5c059f471..21477ab7d7 100644
--- a/modules/repository/adopt.go
+++ b/modules/repository/adopt.go
@@ -68,6 +68,9 @@ func AdoptRepository(doer, u *models.User, opts models.CreateRepoOptions) (*mode
if err := adoptRepository(ctx, repoPath, doer, repo, opts); err != nil {
return fmt.Errorf("createDelegateHooks: %v", err)
}
+ if err := repo.CheckDaemonExportOK(ctx); err != nil {
+ return fmt.Errorf("checkDaemonExportOK: %v", err)
+ }
// Initialize Issue Labels if selected
if len(opts.IssueLabels) > 0 {
diff --git a/modules/repository/create.go b/modules/repository/create.go
index 0e91a73b83..64d92eeb2d 100644
--- a/modules/repository/create.go
+++ b/modules/repository/create.go
@@ -105,7 +105,11 @@ func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (*mod
}
}
- if stdout, err := git.NewCommand("update-server-info").
+ if err := repo.CheckDaemonExportOK(ctx); err != nil {
+ return fmt.Errorf("checkDaemonExportOK: %v", err)
+ }
+
+ if stdout, err := git.NewCommandContext(ctx, "update-server-info").
SetDescription(fmt.Sprintf("CreateRepository(git update-server-info): %s", repoPath)).
RunInDir(repoPath); err != nil {
log.Error("CreateRepository(git update-server-info) in %v: Stdout: %s\nError: %v", repo, stdout, err)
diff --git a/modules/repository/fork.go b/modules/repository/fork.go
index 59c07271a6..df1dccc596 100644
--- a/modules/repository/fork.go
+++ b/modules/repository/fork.go
@@ -97,7 +97,7 @@ func ForkRepository(doer, owner *models.User, opts models.ForkRepoOptions) (_ *m
needsRollback = true
repoPath := models.RepoPath(owner.Name, repo.Name)
- if stdout, err := git.NewCommand(
+ if stdout, err := git.NewCommandContext(ctx,
"clone", "--bare", oldRepoPath, repoPath).
SetDescription(fmt.Sprintf("ForkRepository(git clone): %s to %s", opts.BaseRepo.FullName(), repo.FullName())).
RunInDirTimeout(10*time.Minute, ""); err != nil {
@@ -105,7 +105,11 @@ func ForkRepository(doer, owner *models.User, opts models.ForkRepoOptions) (_ *m
return fmt.Errorf("git clone: %v", err)
}
- if stdout, err := git.NewCommand("update-server-info").
+ if err := repo.CheckDaemonExportOK(ctx); err != nil {
+ return fmt.Errorf("checkDaemonExportOK: %v", err)
+ }
+
+ if stdout, err := git.NewCommandContext(ctx, "update-server-info").
SetDescription(fmt.Sprintf("ForkRepository(git update-server-info): %s", repo.FullName())).
RunInDir(repoPath); err != nil {
log.Error("Fork Repository (git update-server-info) failed for %v:\nStdout: %s\nError: %v", repo, stdout, err)
diff --git a/modules/repository/generate.go b/modules/repository/generate.go
index 4fcebc06dc..f6b76b14af 100644
--- a/modules/repository/generate.go
+++ b/modules/repository/generate.go
@@ -275,5 +275,16 @@ func GenerateRepository(ctx context.Context, doer, owner *models.User, templateR
return generateRepo, err
}
+ if err = generateRepo.CheckDaemonExportOK(ctx); err != nil {
+ return generateRepo, fmt.Errorf("checkDaemonExportOK: %v", err)
+ }
+
+ if stdout, err := git.NewCommandContext(ctx, "update-server-info").
+ SetDescription(fmt.Sprintf("GenerateRepository(git update-server-info): %s", repoPath)).
+ RunInDir(repoPath); err != nil {
+ log.Error("GenerateRepository(git update-server-info) in %v: Stdout: %s\nError: %v", generateRepo, stdout, err)
+ return generateRepo, fmt.Errorf("error in GenerateRepository(git update-server-info): %v", err)
+ }
+
return generateRepo, nil
}
diff --git a/modules/repository/repo.go b/modules/repository/repo.go
index 6b40a894fb..05306218de 100644
--- a/modules/repository/repo.go
+++ b/modules/repository/repo.go
@@ -96,6 +96,21 @@ func MigrateRepositoryGitData(ctx context.Context, u *models.User, repo *models.
}
}
+ if repo.OwnerID == u.ID {
+ repo.Owner = u
+ }
+
+ if err = repo.CheckDaemonExportOK(ctx); err != nil {
+ return repo, fmt.Errorf("checkDaemonExportOK: %v", err)
+ }
+
+ if stdout, err := git.NewCommandContext(ctx, "update-server-info").
+ SetDescription(fmt.Sprintf("MigrateRepositoryGitData(git update-server-info): %s", repoPath)).
+ RunInDir(repoPath); err != nil {
+ log.Error("MigrateRepositoryGitData(git update-server-info) in %v: Stdout: %s\nError: %v", repo, stdout, err)
+ return repo, fmt.Errorf("error in MigrateRepositoryGitData(git update-server-info): %v", err)
+ }
+
gitRepo, err := git.OpenRepository(repoPath)
if err != nil {
return repo, fmt.Errorf("OpenRepository: %v", err)
/option> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/apps/encryption/l10n/fa.js
blob: 85277db61d9d3c3ebb438acf1f7b483fa8a607f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44