|
1 | 1 | #include "cache.h" |
2 | 2 | #include "advice.h" |
| 3 | +#include "gvfs.h" |
3 | 4 | #include "config.h" |
4 | 5 | #include "convert.h" |
5 | 6 | #include "copy.h" |
@@ -555,6 +556,9 @@ static int crlf_to_git(struct index_state *istate, |
555 | 556 | if (!buf) |
556 | 557 | return 1; |
557 | 558 |
|
| 559 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 560 | + die("CRLF conversions not supported when running under GVFS"); |
| 561 | + |
558 | 562 | /* only grow if not in place */ |
559 | 563 | if (strbuf_avail(buf) + buf->len < len) |
560 | 564 | strbuf_grow(buf, len - buf->len); |
@@ -594,6 +598,9 @@ static int crlf_to_worktree(const char *src, size_t len, struct strbuf *buf, |
594 | 598 | if (!will_convert_lf_to_crlf(&stats, crlf_action)) |
595 | 599 | return 0; |
596 | 600 |
|
| 601 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 602 | + die("CRLF conversions not supported when running under GVFS"); |
| 603 | + |
597 | 604 | /* are we "faking" in place editing ? */ |
598 | 605 | if (src == buf->buf) |
599 | 606 | to_free = strbuf_detach(buf, NULL); |
@@ -705,6 +712,9 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le |
705 | 712 | struct async async; |
706 | 713 | struct filter_params params; |
707 | 714 |
|
| 715 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 716 | + die("Filter \"%s\" not supported when running under GVFS", cmd); |
| 717 | + |
708 | 718 | memset(&async, 0, sizeof(async)); |
709 | 719 | async.proc = filter_buffer_or_fd; |
710 | 720 | async.data = ¶ms; |
@@ -1116,6 +1126,9 @@ static int ident_to_git(const char *src, size_t len, |
1116 | 1126 | if (!buf) |
1117 | 1127 | return 1; |
1118 | 1128 |
|
| 1129 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1130 | + die("ident conversions not supported when running under GVFS"); |
| 1131 | + |
1119 | 1132 | /* only grow if not in place */ |
1120 | 1133 | if (strbuf_avail(buf) + buf->len < len) |
1121 | 1134 | strbuf_grow(buf, len - buf->len); |
@@ -1163,6 +1176,9 @@ static int ident_to_worktree(const char *src, size_t len, |
1163 | 1176 | if (!cnt) |
1164 | 1177 | return 0; |
1165 | 1178 |
|
| 1179 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1180 | + die("ident conversions not supported when running under GVFS"); |
| 1181 | + |
1166 | 1182 | /* are we "faking" in place editing ? */ |
1167 | 1183 | if (src == buf->buf) |
1168 | 1184 | to_free = strbuf_detach(buf, NULL); |
@@ -1612,6 +1628,9 @@ static int lf_to_crlf_filter_fn(struct stream_filter *filter, |
1612 | 1628 | size_t count, o = 0; |
1613 | 1629 | struct lf_to_crlf_filter *lf_to_crlf = (struct lf_to_crlf_filter *)filter; |
1614 | 1630 |
|
| 1631 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1632 | + die("CRLF conversions not supported when running under GVFS"); |
| 1633 | + |
1615 | 1634 | /* |
1616 | 1635 | * We may be holding onto the CR to see if it is followed by a |
1617 | 1636 | * LF, in which case we would need to go to the main loop. |
@@ -1856,6 +1875,9 @@ static int ident_filter_fn(struct stream_filter *filter, |
1856 | 1875 | struct ident_filter *ident = (struct ident_filter *)filter; |
1857 | 1876 | static const char head[] = "$Id"; |
1858 | 1877 |
|
| 1878 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1879 | + die("ident conversions not supported when running under GVFS"); |
| 1880 | + |
1859 | 1881 | if (!input) { |
1860 | 1882 | /* drain upon eof */ |
1861 | 1883 | switch (ident->state) { |
|
0 commit comments