Procházet zdrojové kódy

Allow spaces in file/dir names on parsing git diff

Vladimir Vissoultchev před 9 roky
rodič
revize
fac4e27882
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      models/git_diff.go

+ 2 - 2
models/git_diff.go

@@ -167,8 +167,8 @@ func ParsePatch(pid int64, maxlines int, cmd *exec.Cmd, reader io.Reader) (*Diff
 				return diff, nil
 			}
 
-			fs := strings.Split(line[len(DIFF_HEAD):], " ")
-			a := fs[0]
+			beg := len(DIFF_HEAD)
+			a := line[beg : (len(line)-beg)/2+beg]
 
 			curFile = &DiffFile{
 				Name:     a[strings.Index(a, "/")+1:],