Permalink
Browse files

Only calculate file diffs for non-binary files

  • Loading branch information...
jvdzwaan committed Sep 24, 2016
1 parent e27c8dc commit c21cf76d580ae46b77d91ed99064645873ebf5b9
Showing with 4 additions and 1 deletion.
  1. +3 −1 recipy/log.py
  2. +1 −0 requirements.txt
View
@@ -13,6 +13,7 @@
import difflib
import warnings
import codecs
from binaryornot.check import is_binary
from recipyCommon.version_control import add_git_info, add_svn_info, hash_file
from recipyCommon.config import option_set, get_db_path
@@ -171,7 +172,8 @@ def log_output(filename, source):
db = open_or_create_db()
if option_set('data', 'file_diff_outputs') and os.path.isfile(filename):
if option_set('data', 'file_diff_outputs') and os.path.isfile(filename) \
and not is_binary(filename):
tf = tempfile.NamedTemporaryFile(delete=False)
shutil.copy2(filename, tf.name)
add_file_diff_to_db(filename, tf.name, db)
View
@@ -13,3 +13,4 @@ flask-testing
blinker
six
colorama
binaryornot

0 comments on commit c21cf76

Please sign in to comment.