| 1857 | } |
| 1858 | |
| 1859 | static char *quote_ref_url(const char *base, const char *ref) |
| 1860 | { |
| 1861 | struct strbuf buf = STRBUF_INIT; |
| 1862 | const char *cp; |
| 1863 | int ch; |
| 1864 | |
| 1865 | end_url_with_slash(&buf, base); |
| 1866 | |
| 1867 | for (cp = ref; (ch = *cp) != 0; cp++) |
| 1868 | if (needs_quote(ch)) |
| 1869 | strbuf_addf(&buf, "%%%02x", ch); |
| 1870 | else |
| 1871 | strbuf_addch(&buf, *cp); |
| 1872 | |
| 1873 | return strbuf_detach(&buf, NULL); |
| 1874 | } |
| 1875 | |
| 1876 | void append_remote_object_url(struct strbuf *buf, const char *url, |
| 1877 | const char *hex, |
no test coverage detected