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