aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/auth/repo_form.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go
index daec8a2a..c9311530 100644
--- a/modules/auth/repo_form.go
+++ b/modules/auth/repo_form.go
@@ -327,6 +327,10 @@ func (f *EditRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) b
return validate(errs, ctx.Data, f, ctx.Locale)
}
+func (f *EditRepoFileForm) IsNewBrnach() bool {
+ return f.CommitChoice == "commit-to-new-branch"
+}
+
type EditPreviewDiffForm struct {
Content string
}
@@ -356,6 +360,10 @@ func (f *UploadRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors)
return validate(errs, ctx.Data, f, ctx.Locale)
}
+func (f *UploadRepoFileForm) IsNewBrnach() bool {
+ return f.CommitChoice == "commit-to-new-branch"
+}
+
type RemoveUploadFileForm struct {
File string `binding:"Required;MaxSize(50)"`
}
@@ -381,3 +389,7 @@ type DeleteRepoFileForm struct {
func (f *DeleteRepoFileForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors {
return validate(errs, ctx.Data, f, ctx.Locale)
}
+
+func (f *DeleteRepoFileForm) IsNewBrnach() bool {
+ return f.CommitChoice == "commit-to-new-branch"
+}