|
3 | 3 |
|
4 | 4 | #include "git-compat-util.h" |
5 | 5 | #include "advice.h" |
| 6 | +#include "gvfs.h" |
6 | 7 | #include "config.h" |
7 | 8 | #include "convert.h" |
8 | 9 | #include "copy.h" |
@@ -563,6 +564,9 @@ static int crlf_to_git(struct index_state *istate, |
563 | 564 | if (!buf) |
564 | 565 | return 1; |
565 | 566 |
|
| 567 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 568 | + die("CRLF conversions not supported when running under GVFS"); |
| 569 | + |
566 | 570 | /* only grow if not in place */ |
567 | 571 | if (strbuf_avail(buf) + buf->len < len) |
568 | 572 | strbuf_grow(buf, len - buf->len); |
@@ -602,6 +606,9 @@ static int crlf_to_worktree(const char *src, size_t len, struct strbuf *buf, |
602 | 606 | if (!will_convert_lf_to_crlf(&stats, crlf_action)) |
603 | 607 | return 0; |
604 | 608 |
|
| 609 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 610 | + die("CRLF conversions not supported when running under GVFS"); |
| 611 | + |
605 | 612 | /* are we "faking" in place editing ? */ |
606 | 613 | if (src == buf->buf) |
607 | 614 | to_free = strbuf_detach(buf, NULL); |
@@ -711,6 +718,9 @@ static int apply_single_file_filter(const char *path, const char *src, size_t le |
711 | 718 | struct async async; |
712 | 719 | struct filter_params params; |
713 | 720 |
|
| 721 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 722 | + die("Filter \"%s\" not supported when running under GVFS", cmd); |
| 723 | + |
714 | 724 | memset(&async, 0, sizeof(async)); |
715 | 725 | async.proc = filter_buffer_or_fd; |
716 | 726 | async.data = ¶ms; |
@@ -1130,6 +1140,9 @@ static int ident_to_git(const char *src, size_t len, |
1130 | 1140 | if (!buf) |
1131 | 1141 | return 1; |
1132 | 1142 |
|
| 1143 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1144 | + die("ident conversions not supported when running under GVFS"); |
| 1145 | + |
1133 | 1146 | /* only grow if not in place */ |
1134 | 1147 | if (strbuf_avail(buf) + buf->len < len) |
1135 | 1148 | strbuf_grow(buf, len - buf->len); |
@@ -1177,6 +1190,9 @@ static int ident_to_worktree(const char *src, size_t len, |
1177 | 1190 | if (!cnt) |
1178 | 1191 | return 0; |
1179 | 1192 |
|
| 1193 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1194 | + die("ident conversions not supported when running under GVFS"); |
| 1195 | + |
1180 | 1196 | /* are we "faking" in place editing ? */ |
1181 | 1197 | if (src == buf->buf) |
1182 | 1198 | to_free = strbuf_detach(buf, NULL); |
@@ -1629,6 +1645,9 @@ static int lf_to_crlf_filter_fn(struct stream_filter *filter, |
1629 | 1645 | size_t count, o = 0; |
1630 | 1646 | struct lf_to_crlf_filter *lf_to_crlf = (struct lf_to_crlf_filter *)filter; |
1631 | 1647 |
|
| 1648 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1649 | + die("CRLF conversions not supported when running under GVFS"); |
| 1650 | + |
1632 | 1651 | /* |
1633 | 1652 | * We may be holding onto the CR to see if it is followed by a |
1634 | 1653 | * LF, in which case we would need to go to the main loop. |
@@ -1873,6 +1892,9 @@ static int ident_filter_fn(struct stream_filter *filter, |
1873 | 1892 | struct ident_filter *ident = (struct ident_filter *)filter; |
1874 | 1893 | static const char head[] = "$Id"; |
1875 | 1894 |
|
| 1895 | + if (gvfs_config_is_set(GVFS_BLOCK_FILTERS_AND_EOL_CONVERSIONS)) |
| 1896 | + die("ident conversions not supported when running under GVFS"); |
| 1897 | + |
1876 | 1898 | if (!input) { |
1877 | 1899 | /* drain upon eof */ |
1878 | 1900 | switch (ident->state) { |
|
0 commit comments