Skip to content

Commit 2413513

Browse files
Merge branch 'feat-32257-add-comments-unchanged-lines-and-show' of github.com:rajesh-jonnalagadda/gitea into feat-32257-add-comments-unchanged-lines-and-show
2 parents 96849dd + 67343d6 commit 2413513

File tree

99 files changed

+3007
-1294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+3007
-1294
lines changed

.eslintrc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ rules:
818818
unicorn/consistent-destructuring: [2]
819819
unicorn/consistent-empty-array-spread: [2]
820820
unicorn/consistent-existence-index-check: [0]
821-
unicorn/consistent-function-scoping: [2]
821+
unicorn/consistent-function-scoping: [0]
822822
unicorn/custom-error-definition: [0]
823823
unicorn/empty-brace-spaces: [2]
824824
unicorn/error-message: [0]

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _testmain.go
2828
*.exe
2929
*.test
3030
*.prof
31-
*.tsbuildInfo
31+
*.tsbuildinfo
3232

3333
*coverage.out
3434
coverage.all

CHANGELOG.md

Lines changed: 393 additions & 0 deletions
Large diffs are not rendered by default.

modules/git/repo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ func Push(ctx context.Context, repoPath string, opts PushOptions) error {
223223
if err != nil {
224224
if strings.Contains(stderr, "non-fast-forward") {
225225
return &ErrPushOutOfDate{StdOut: stdout, StdErr: stderr, Err: err}
226-
} else if strings.Contains(stderr, "! [remote rejected]") {
226+
} else if strings.Contains(stderr, "! [remote rejected]") || strings.Contains(stderr, "! [rejected]") {
227227
err := &ErrPushRejected{StdOut: stdout, StdErr: stderr, Err: err}
228228
err.GenerateMessage()
229229
return err

modules/templates/helper.go

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func NewFuncMap() template.FuncMap {
4242
"HTMLFormat": htmlutil.HTMLFormat,
4343
"HTMLEscape": htmlEscape,
4444
"QueryEscape": queryEscape,
45+
"QueryBuild": queryBuild,
4546
"JSEscape": jsEscapeSafe,
4647
"SanitizeHTML": SanitizeHTML,
4748
"URLJoin": util.URLJoin,
@@ -293,6 +294,69 @@ func timeEstimateString(timeSec any) string {
293294
return util.TimeEstimateString(v)
294295
}
295296

297+
func queryBuild(a ...any) template.URL {
298+
var s string
299+
if len(a)%2 == 1 {
300+
if v, ok := a[0].(string); ok {
301+
if v == "" || (v[0] != '?' && v[0] != '&') {
302+
panic("queryBuild: invalid argument")
303+
}
304+
s = v
305+
} else if v, ok := a[0].(template.URL); ok {
306+
s = string(v)
307+
} else {
308+
panic("queryBuild: invalid argument")
309+
}
310+
}
311+
for i := len(a) % 2; i < len(a); i += 2 {
312+
k, ok := a[i].(string)
313+
if !ok {
314+
panic("queryBuild: invalid argument")
315+
}
316+
var v string
317+
if va, ok := a[i+1].(string); ok {
318+
v = va
319+
} else if a[i+1] != nil {
320+
v = fmt.Sprint(a[i+1])
321+
}
322+
// pos1 to pos2 is the "k=v&" part, "&" is optional
323+
pos1 := strings.Index(s, "&"+k+"=")
324+
if pos1 != -1 {
325+
pos1++
326+
} else {
327+
pos1 = strings.Index(s, "?"+k+"=")
328+
if pos1 != -1 {
329+
pos1++
330+
} else if strings.HasPrefix(s, k+"=") {
331+
pos1 = 0
332+
}
333+
}
334+
pos2 := len(s)
335+
if pos1 == -1 {
336+
pos1 = len(s)
337+
} else {
338+
pos2 = pos1 + 1
339+
for pos2 < len(s) && s[pos2-1] != '&' {
340+
pos2++
341+
}
342+
}
343+
if v != "" {
344+
sep := ""
345+
hasPrefixSep := pos1 == 0 || (pos1 <= len(s) && (s[pos1-1] == '?' || s[pos1-1] == '&'))
346+
if !hasPrefixSep {
347+
sep = "&"
348+
}
349+
s = s[:pos1] + sep + k + "=" + url.QueryEscape(v) + "&" + s[pos2:]
350+
} else {
351+
s = s[:pos1] + s[pos2:]
352+
}
353+
}
354+
if s != "" && s != "&" && s[len(s)-1] == '&' {
355+
s = s[:len(s)-1]
356+
}
357+
return template.URL(s)
358+
}
359+
296360
func panicIfDevOrTesting() {
297361
if !setting.IsProd || setting.IsInTesting {
298362
panic("legacy template functions are for backward compatibility only, do not use them in new code")

options/gitignore/Alteryx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ CASS.ini
2929
*.gzlc
3030

3131
## gitignore reference sites
32-
# https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#Ignoring-Files
32+
# https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring
3333
# https://git-scm.com/docs/gitignore
3434
# https://help.github.com/articles/ignoring-files/
3535

options/gitignore/ECU-TEST

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# gitignore template for ECU-TEST workspaces - by TraceTronic https://tracetronic.com
2+
# website: https://www.ecu-test.com
3+
# * all directories are related to the default directories, please adapt the .gitignore if you use customized
4+
# directories
5+
6+
# Dynamic workspace settings
7+
# * We don't recommend to ignore the .workspace directory, because of important project specific settings
8+
# local user settings
9+
.workspace/ETdrive.xml
10+
.workspace/favorites.xml
11+
.workspace/filters.xml
12+
.workspace/generators.xml
13+
.workspace/history.xml
14+
.workspace/parallelExecution.xml
15+
.workspace/signalviewer.xml
16+
.workspace/signalViewerHistory.json
17+
.workspace/signalviewer2layout.xml
18+
.workspace/testeditor.xml
19+
.workspace/tooladapter.xml
20+
.workspace/view.xml
21+
# optional, if your process depends on this file remove exclusion
22+
.workspace/interactiveexecution.xml
23+
.workspace/pythonlibrary.xml
24+
# deprecated, support for older versions
25+
.workspace/traceexplorer.xml
26+
27+
# Custom file formats and test dependencies
28+
# * you can manage your artifacts also with TEST-GUIDE (https://www.test-guide.info) and reference them via Playbooks
29+
*.arxml
30+
*.a2l
31+
*.dbc
32+
*.hex
33+
*.s19
34+
[tT]estdata
35+
[tT]estdaten
36+
37+
# Test results and test execution related content
38+
# * Git is not intended to store and provide test results for all iterations
39+
# * We recommend to use TEST-GUIDE (https://www.test-guide.info) for the test report management
40+
TestReports
41+
42+
# Report generators and templates
43+
# * if you want to provide (f.e.) your own report generators exclude the directory here and ignore only the
44+
# unnecessary subdirectories
45+
Templates
46+
47+
# Exclude large binary artifacts
48+
# * you can manage your artifacts also with TEST-GUIDE (https://www.test-guide.info) and reference them via Playbooks
49+
Offline-FIUs
50+
Offline-Models
51+
Offline-SGBDs
52+
*.exe
53+
*.msi
54+
*.zip
55+
*.7z
56+
57+
# Exclude default and custom temporary directories
58+
Backup_*
59+
60+
# Python bytecode and cache files
61+
__pycache__/
62+
*.py[cod]

options/gitignore/Kotlin

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@
2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
2424
replay_pid*
25+
26+
# Kotlin Gradle plugin data, see https://kotlinlang.org/docs/whatsnew20.html#new-directory-for-kotlin-data-in-gradle-projects
27+
.kotlin/

options/gitignore/Laravel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ Homestead.yaml
2121
Homestead.json
2222
/.vagrant
2323
.phpunit.result.cache
24+
25+
/public/build
26+
/storage/pail
27+
.env.backup
28+
.env.production
29+
.phpactor.json
30+
auth.json

options/gitignore/Move

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Generated by Move
2+
# will have compiled files
3+
build/
4+
5+
# Remove possibly saving credentials to the git repository
6+
.aptos/

0 commit comments

Comments
 (0)