files.add(status.split()[-1])
for file in files:
# check for newline mismatch
- if util.mixed_newlines(file):
+ # HACK: using git diff to tell if files are binary or not
+ if not len(sh.eval("git", "diff", file).splitlines()) == 1 and util.mixed_newlines(file):
# this code only works on Unix
def get_newline(filename):
f = open(filename, "U")
if s != "" and f.newlines is None:
f.readline()
if not isinstance(f.newlines, str):
- raise Exception("Assert: expected newlines to be string, instead was %s" % repr(f.newlines))
+ raise Exception("Assert: expected newlines to be string, instead was %s in %s" % (repr(f.newlines), file))
return f.newlines
def create_reference(id):
f = tempfile.NamedTemporaryFile(prefix="wizardResolve", delete=False)