瀏覽代碼

Workaround bad modifications

Vadim Markovtsev 8 年之前
父節點
當前提交
25ce7fedea
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      analyser.go

+ 3 - 1
analyser.go

@@ -105,7 +105,9 @@ func (analyser *Analyser) handleModification(
 	str_to := str(blob_to)
 	file, exists := files[change.From.Name]
 	if !exists {
-		panic(fmt.Sprintf("file %s does not exist", change.From.Name))
+		fmt.Fprintf(os.Stderr, "warning: file %s does not exist\n", change.From.Name)
+		analyser.handleInsertion(change, day, status, files)
+		return
 	}
 	// possible rename
 	if change.To.Name != change.From.Name {