This one I overlooked before
This commit is contained in:
parent
60c82a8780
commit
f14232d2e9
|
@ -34,7 +34,7 @@ const (
|
|||
DiffLinePlain DiffLineType = iota + 1
|
||||
DiffLineAdd
|
||||
DiffLineDel
|
||||
DIFF_LINE_SECTION
|
||||
DiffLineSection
|
||||
)
|
||||
|
||||
type DiffFileType uint8
|
||||
|
@ -43,7 +43,7 @@ const (
|
|||
DiffFileAdd DiffFileType = iota + 1
|
||||
DiffFileChange
|
||||
DiffFileDel
|
||||
DIFF_FILE_RENAME
|
||||
DiffFileRename
|
||||
)
|
||||
|
||||
type DiffLine struct {
|
||||
|
@ -273,7 +273,7 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
|
|||
curSection = &DiffSection{}
|
||||
curFile.Sections = append(curFile.Sections, curSection)
|
||||
ss := strings.Split(line, "@@")
|
||||
diffLine := &DiffLine{Type: DIFF_LINE_SECTION, Content: line}
|
||||
diffLine := &DiffLine{Type: DiffLineSection, Content: line}
|
||||
curSection.Lines = append(curSection.Lines, diffLine)
|
||||
|
||||
// Parse line number.
|
||||
|
@ -362,7 +362,7 @@ func ParsePatch(maxLines, maxLineCharacteres, maxFiles int, reader io.Reader) (*
|
|||
case strings.HasPrefix(line, "index"):
|
||||
curFile.Type = DiffFileChange
|
||||
case strings.HasPrefix(line, "similarity index 100%"):
|
||||
curFile.Type = DIFF_FILE_RENAME
|
||||
curFile.Type = DiffFileRename
|
||||
curFile.IsRenamed = true
|
||||
curFile.OldName = curFile.Name
|
||||
curFile.Name = b
|
||||
|
|
|
@ -35,7 +35,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
_TPL_UPDATE_HOOK = "#!/usr/bin/env %s\n%s update $1 $2 $3 --config='%s'\n"
|
||||
tplUpdateHook = "#!/usr/bin/env %s\n%s update $1 $2 $3 --config='%s'\n"
|
||||
)
|
||||
|
||||
var repoWorkingPool = sync.NewExclusivePool()
|
||||
|
@ -706,7 +706,7 @@ func cleanUpMigrateGitConfig(configPath string) error {
|
|||
|
||||
func createUpdateHook(repoPath string) error {
|
||||
return git.SetUpdateHook(repoPath,
|
||||
fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+setting.AppPath+"\"", setting.CustomConf))
|
||||
fmt.Sprintf(tplUpdateHook, setting.ScriptType, "\""+setting.AppPath+"\"", setting.CustomConf))
|
||||
}
|
||||
|
||||
// Finish migrating repository and/or wiki with things that don't need to be done for mirrors.
|
||||
|
|
Loading…
Reference in New Issue