author | Junio C Hamano <gitster@pobox.com> | |
Tue, 28 Feb 2012 21:25:57 +0000 (13:25 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 28 Feb 2012 21:25:57 +0000 (13:25 -0800) |
* jb/required-filter:
Add a setting to require a filter to be successful
Conflicts:
convert.c
Add a setting to require a filter to be successful
Conflicts:
convert.c
1 | 2 | |||
---|---|---|---|---|
convert.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc convert.c
index 4534e2c2b003998a590637fc43c0549ff23f71b2,c06309f5e102c36f5751fce8cb83229ff9acca42..66021550c32f86e662fe5da84c852e80ae790450
+++ b/convert.c
struct conv_attrs ca;
convert_attrs(&ca, path);
- if (ca.drv)
+ if (ca.drv) {
filter = ca.drv->clean;
+ required = ca.drv->required;
+ }
ret |= apply_filter(path, src, len, dst, filter);
- if (ret) {
+ if (!ret && required)
+ die("%s: clean filter '%s' failed", path, ca.drv->name);
+
+ if (ret && dst) {
src = dst->buf;
len = dst->len;
}