mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	fix huge diff hangs
This commit is contained in:
		@@ -3,7 +3,7 @@ Gogs - Go Git Service [
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
##### Current version: 0.8.3
 | 
					##### Current version: 0.8.4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| Web | UI  | Preview  |
 | 
					| Web | UI  | Preview  |
 | 
				
			||||||
|:-------------:|:-------:|:-------:|
 | 
					|:-------------:|:-------:|:-------:|
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -88,7 +88,7 @@ func checkVersion() {
 | 
				
			|||||||
		{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
 | 
							{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
 | 
				
			||||||
		{"gopkg.in/ini.v1", ini.Version, "1.8.4"},
 | 
							{"gopkg.in/ini.v1", ini.Version, "1.8.4"},
 | 
				
			||||||
		{"gopkg.in/macaron.v1", macaron.Version, "0.8.0"},
 | 
							{"gopkg.in/macaron.v1", macaron.Version, "0.8.0"},
 | 
				
			||||||
		{"github.com/gogits/git-shell", git.Version, "0.2.0"},
 | 
							{"github.com/gogits/git-shell", git.Version, "0.2.1"},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	for _, c := range checkers {
 | 
						for _, c := range checkers {
 | 
				
			||||||
		if !version.Compare(c.Version(), c.Expected, ">=") {
 | 
							if !version.Compare(c.Version(), c.Expected, ">=") {
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								gogs.go
									
									
									
									
									
								
							@@ -18,7 +18,7 @@ import (
 | 
				
			|||||||
	"github.com/gogits/gogs/modules/setting"
 | 
						"github.com/gogits/gogs/modules/setting"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const APP_VER = "0.8.3.1214"
 | 
					const APP_VER = "0.8.4.1214"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
						runtime.GOMAXPROCS(runtime.NumCPU())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ import (
 | 
				
			|||||||
	"bytes"
 | 
						"bytes"
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"io"
 | 
						"io"
 | 
				
			||||||
 | 
						"io/ioutil"
 | 
				
			||||||
	"os"
 | 
						"os"
 | 
				
			||||||
	"os/exec"
 | 
						"os/exec"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
@@ -124,6 +125,7 @@ func ParsePatch(maxlines int, reader io.Reader) (*Diff, error) {
 | 
				
			|||||||
		// Diff data too large, we only show the first about maxlines lines
 | 
							// Diff data too large, we only show the first about maxlines lines
 | 
				
			||||||
		if lineCount >= maxlines {
 | 
							if lineCount >= maxlines {
 | 
				
			||||||
			log.Warn("Diff data too large")
 | 
								log.Warn("Diff data too large")
 | 
				
			||||||
 | 
								io.Copy(ioutil.Discard, reader)
 | 
				
			||||||
			diff.Files = nil
 | 
								diff.Files = nil
 | 
				
			||||||
			return diff, nil
 | 
								return diff, nil
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1 +1 @@
 | 
				
			|||||||
0.8.3.1214
 | 
					0.8.4.1214
 | 
				
			||||||
		Reference in New Issue
	
	Block a user