mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 00:01:32 -04:00
Compare commits
No commits in common. "ff7057a46dfc3e1db83e26ea770246a7e253f450" and "111c5092878c1701909d89fd1075262cf415d6f2" have entirely different histories.
ff7057a46d
...
111c509287
2
Makefile
2
Makefile
@ -859,8 +859,6 @@ fomantic:
|
|||||||
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
|
cp -f $(FOMANTIC_WORK_DIR)/theme.config.less $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/theme.config
|
||||||
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
|
cp -rf $(FOMANTIC_WORK_DIR)/_site $(FOMANTIC_WORK_DIR)/node_modules/fomantic-ui/src/
|
||||||
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
|
cd $(FOMANTIC_WORK_DIR) && npx gulp -f node_modules/fomantic-ui/gulpfile.js build
|
||||||
# fomantic uses "touchstart" as click event for some browsers, it's not ideal, so we force fomantic to always use "click" as click event
|
|
||||||
$(SED_INPLACE) -e 's/clickEvent[ \t]*=/clickEvent = "click", unstableClickEvent =/g' $(FOMANTIC_WORK_DIR)/build/semantic.js
|
|
||||||
$(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js
|
$(SED_INPLACE) -e 's/\r//g' $(FOMANTIC_WORK_DIR)/build/semantic.css $(FOMANTIC_WORK_DIR)/build/semantic.js
|
||||||
rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
|
rm -f $(FOMANTIC_WORK_DIR)/build/*.min.*
|
||||||
|
|
||||||
|
25
cmd/serv.go
25
cmd/serv.go
@ -11,7 +11,6 @@ import (
|
|||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -291,21 +290,17 @@ func runServ(c *cli.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var gitcmd *exec.Cmd
|
// Special handle for Windows.
|
||||||
gitBinPath := filepath.Dir(git.GitExecutable) // e.g. /usr/bin
|
if setting.IsWindows {
|
||||||
gitBinVerb := filepath.Join(gitBinPath, verb) // e.g. /usr/bin/git-upload-pack
|
verb = strings.Replace(verb, "-", " ", 1)
|
||||||
if _, err := os.Stat(gitBinVerb); err != nil {
|
|
||||||
// if the command "git-upload-pack" doesn't exist, try to split "git-upload-pack" to use the sub-command with git
|
|
||||||
// ps: Windows only has "git.exe" in the bin path, so Windows always uses this way
|
|
||||||
verbFields := strings.SplitN(verb, "-", 2)
|
|
||||||
if len(verbFields) == 2 {
|
|
||||||
// use git binary with the sub-command part: "C:\...\bin\git.exe", "upload-pack", ...
|
|
||||||
gitcmd = exec.CommandContext(ctx, git.GitExecutable, verbFields[1], repoPath)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if gitcmd == nil {
|
|
||||||
// by default, use the verb (it has been checked above by allowedCommands)
|
var gitcmd *exec.Cmd
|
||||||
gitcmd = exec.CommandContext(ctx, gitBinVerb, repoPath)
|
verbs := strings.Split(verb, " ")
|
||||||
|
if len(verbs) == 2 {
|
||||||
|
gitcmd = exec.CommandContext(ctx, verbs[0], verbs[1], repoPath)
|
||||||
|
} else {
|
||||||
|
gitcmd = exec.CommandContext(ctx, verb, repoPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
process.SetSysProcAttribute(gitcmd)
|
process.SetSysProcAttribute(gitcmd)
|
||||||
|
@ -194,7 +194,6 @@ func InsertRun(ctx context.Context, run *ActionRun, jobs []*jobparser.SingleWork
|
|||||||
if len(needs) > 0 {
|
if len(needs) > 0 {
|
||||||
status = StatusBlocked
|
status = StatusBlocked
|
||||||
}
|
}
|
||||||
job.Name, _ = util.SplitStringAtByteN(job.Name, 255)
|
|
||||||
runJobs = append(runJobs, &ActionRunJob{
|
runJobs = append(runJobs, &ActionRunJob{
|
||||||
RunID: run.ID,
|
RunID: run.ID,
|
||||||
RepoID: run.RepoID,
|
RepoID: run.RepoID,
|
||||||
|
@ -298,9 +298,8 @@ func CreateTaskForRunner(ctx context.Context, runner *ActionRunner) (*ActionTask
|
|||||||
if len(workflowJob.Steps) > 0 {
|
if len(workflowJob.Steps) > 0 {
|
||||||
steps := make([]*ActionTaskStep, len(workflowJob.Steps))
|
steps := make([]*ActionTaskStep, len(workflowJob.Steps))
|
||||||
for i, v := range workflowJob.Steps {
|
for i, v := range workflowJob.Steps {
|
||||||
name, _ := util.SplitStringAtByteN(v.String(), 255)
|
|
||||||
steps[i] = &ActionTaskStep{
|
steps[i] = &ActionTaskStep{
|
||||||
Name: name,
|
Name: v.String(),
|
||||||
TaskID: task.ID,
|
TaskID: task.ID,
|
||||||
Index: int64(i),
|
Index: int64(i),
|
||||||
RepoID: task.RepoID,
|
RepoID: task.RepoID,
|
||||||
|
@ -312,7 +312,7 @@ func CheckGitVersionAtLeast(atLeast string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func configSet(key, value string) error {
|
func configSet(key, value string) error {
|
||||||
stdout, _, err := NewCommand(DefaultContext, "config", "--global", "--get").AddDynamicArguments(key).RunStdString(nil)
|
stdout, _, err := NewCommand(DefaultContext, "config", "--get").AddDynamicArguments(key).RunStdString(nil)
|
||||||
if err != nil && !err.IsExitCode(1) {
|
if err != nil && !err.IsExitCode(1) {
|
||||||
return fmt.Errorf("failed to get git config %s, err: %w", key, err)
|
return fmt.Errorf("failed to get git config %s, err: %w", key, err)
|
||||||
}
|
}
|
||||||
@ -331,7 +331,7 @@ func configSet(key, value string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func configSetNonExist(key, value string) error {
|
func configSetNonExist(key, value string) error {
|
||||||
_, _, err := NewCommand(DefaultContext, "config", "--global", "--get").AddDynamicArguments(key).RunStdString(nil)
|
_, _, err := NewCommand(DefaultContext, "config", "--get").AddDynamicArguments(key).RunStdString(nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// already exist
|
// already exist
|
||||||
return nil
|
return nil
|
||||||
@ -349,7 +349,7 @@ func configSetNonExist(key, value string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func configAddNonExist(key, value string) error {
|
func configAddNonExist(key, value string) error {
|
||||||
_, _, err := NewCommand(DefaultContext, "config", "--global", "--get").AddDynamicArguments(key, regexp.QuoteMeta(value)).RunStdString(nil)
|
_, _, err := NewCommand(DefaultContext, "config", "--get").AddDynamicArguments(key, regexp.QuoteMeta(value)).RunStdString(nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// already exist
|
// already exist
|
||||||
return nil
|
return nil
|
||||||
@ -366,7 +366,7 @@ func configAddNonExist(key, value string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func configUnsetAll(key, value string) error {
|
func configUnsetAll(key, value string) error {
|
||||||
_, _, err := NewCommand(DefaultContext, "config", "--global", "--get").AddDynamicArguments(key).RunStdString(nil)
|
_, _, err := NewCommand(DefaultContext, "config", "--get").AddDynamicArguments(key).RunStdString(nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
// exist, need to remove
|
// exist, need to remove
|
||||||
_, _, err = NewCommand(DefaultContext, "config", "--global", "--unset-all").AddDynamicArguments(key, regexp.QuoteMeta(value)).RunStdString(nil)
|
_, _, err = NewCommand(DefaultContext, "config", "--global", "--unset-all").AddDynamicArguments(key, regexp.QuoteMeta(value)).RunStdString(nil)
|
||||||
|
@ -12,7 +12,6 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/actions"
|
"code.gitea.io/gitea/modules/actions"
|
||||||
"code.gitea.io/gitea/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/util"
|
|
||||||
actions_service "code.gitea.io/gitea/services/actions"
|
actions_service "code.gitea.io/gitea/services/actions"
|
||||||
|
|
||||||
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
runnerv1 "code.gitea.io/actions-proto-go/runner/v1"
|
||||||
@ -56,10 +55,9 @@ func (s *Service) Register(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create new runner
|
// create new runner
|
||||||
name, _ := util.SplitStringAtByteN(req.Msg.Name, 255)
|
|
||||||
runner := &actions_model.ActionRunner{
|
runner := &actions_model.ActionRunner{
|
||||||
UUID: gouuid.New().String(),
|
UUID: gouuid.New().String(),
|
||||||
Name: name,
|
Name: req.Msg.Name,
|
||||||
OwnerID: runnerToken.OwnerID,
|
OwnerID: runnerToken.OwnerID,
|
||||||
RepoID: runnerToken.RepoID,
|
RepoID: runnerToken.RepoID,
|
||||||
AgentLabels: req.Msg.AgentLabels,
|
AgentLabels: req.Msg.AgentLabels,
|
||||||
|
4
web_src/fomantic/build/semantic.js
generated
4
web_src/fomantic/build/semantic.js
generated
@ -2118,7 +2118,7 @@ $.fn.dimmer = function(parameters) {
|
|||||||
moduleNamespace = 'module-' + namespace,
|
moduleNamespace = 'module-' + namespace,
|
||||||
moduleSelector = $allModules.selector || '',
|
moduleSelector = $allModules.selector || '',
|
||||||
|
|
||||||
clickEvent = "click", unstableClickEvent = ('ontouchstart' in document.documentElement)
|
clickEvent = ('ontouchstart' in document.documentElement)
|
||||||
? 'touchstart'
|
? 'touchstart'
|
||||||
: 'click',
|
: 'click',
|
||||||
|
|
||||||
@ -2850,7 +2850,7 @@ $.fn.dropdown = function(parameters) {
|
|||||||
moduleSelector = $allModules.selector || '',
|
moduleSelector = $allModules.selector || '',
|
||||||
|
|
||||||
hasTouch = ('ontouchstart' in document.documentElement),
|
hasTouch = ('ontouchstart' in document.documentElement),
|
||||||
clickEvent = "click", unstableClickEvent = hasTouch
|
clickEvent = hasTouch
|
||||||
? 'touchstart'
|
? 'touchstart'
|
||||||
: 'click',
|
: 'click',
|
||||||
|
|
||||||
|
@ -77,9 +77,6 @@ export async function createCommentEasyMDE(textarea, easyMDEOptions = {}) {
|
|||||||
|
|
||||||
const inputField = easyMDE.codemirror.getInputField();
|
const inputField = easyMDE.codemirror.getInputField();
|
||||||
|
|
||||||
easyMDE.codemirror.on('change', (...args) => {
|
|
||||||
easyMDEOptions?.onChange?.(...args);
|
|
||||||
});
|
|
||||||
easyMDE.codemirror.setOption('extraKeys', {
|
easyMDE.codemirror.setOption('extraKeys', {
|
||||||
'Cmd-Enter': codeMirrorQuickSubmit,
|
'Cmd-Enter': codeMirrorQuickSubmit,
|
||||||
'Ctrl-Enter': codeMirrorQuickSubmit,
|
'Ctrl-Enter': codeMirrorQuickSubmit,
|
||||||
|
@ -85,18 +85,12 @@ export function initRepoCommentForm() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const $statusButton = $('#status-button');
|
|
||||||
for (const textarea of $commentForm.find('textarea:not(.review-textarea, .no-easymde)')) {
|
for (const textarea of $commentForm.find('textarea:not(.review-textarea, .no-easymde)')) {
|
||||||
// Don't initialize EasyMDE for the dormant #edit-content-form
|
// Don't initialize EasyMDE for the dormant #edit-content-form
|
||||||
if (textarea.closest('#edit-content-form')) {
|
if (textarea.closest('#edit-content-form')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const easyMDE = await createCommentEasyMDE(textarea, {
|
const easyMDE = await createCommentEasyMDE(textarea);
|
||||||
'onChange': () => {
|
|
||||||
const value = easyMDE?.value().trim();
|
|
||||||
$statusButton.text($statusButton.attr(value.length === 0 ? 'data-status' : 'data-status-and-comment'));
|
|
||||||
},
|
|
||||||
});
|
|
||||||
initEasyMDEImagePaste(easyMDE, $commentForm.find('.dropzone'));
|
initEasyMDEImagePaste(easyMDE, $commentForm.find('.dropzone'));
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user