summaryrefslogtreecommitdiff
path: root/t/t5547-push-quarantine.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-12-12 19:52:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-12 23:10:43 (GMT)
commitcf3c6352100a0d302276e46e3f9a7f0804e224d8 (patch)
tree6722d811a4918a54dc02d9ae57670d343dc3f93c /t/t5547-push-quarantine.sh
parent9b519609a625386f517545ab31de147ad6f433cb (diff)
downloadgit-cf3c6352100a0d302276e46e3f9a7f0804e224d8.zip
git-cf3c6352100a0d302276e46e3f9a7f0804e224d8.tar.gz
git-cf3c6352100a0d302276e46e3f9a7f0804e224d8.tar.bz2
alternates: accept double-quoted paths
We read lists of alternates from objects/info/alternates files (delimited by newline), as well as from the GIT_ALTERNATE_OBJECT_DIRECTORIES environment variable (delimited by colon or semi-colon, depending on the platform). There's no mechanism for quoting the delimiters, so it's impossible to specify an alternate path that contains a colon in the environment, or one that contains a newline in a file. We've lived with that restriction for ages because both alternates and filenames with colons are relatively rare, and it's only a problem when the two meet. But since 722ff7f87 (receive-pack: quarantine objects until pre-receive accepts, 2016-10-03), which builds on the alternates system, every push causes the receiver to set GIT_ALTERNATE_OBJECT_DIRECTORIES internally. It would be convenient to have some way to quote the delimiter so that we can represent arbitrary paths. The simplest thing would be an escape character before a quoted delimiter (e.g., "\:" as a literal colon). But that creates a backwards compatibility problem: any path which uses that escape character is now broken, and we've just shifted the problem. We could choose an unlikely escape character (e.g., something from the non-printable ASCII range), but that's awkward to use. Instead, let's treat names as unquoted unless they begin with a double-quote, in which case they are interpreted via our usual C-stylke quoting rules. This also breaks backwards-compatibility, but in a smaller way: it only matters if your file has a double-quote as the very _first_ character in the path (whereas an escape character is a problem anywhere in the path). It's also consistent with many other parts of git, which accept either a bare pathname or a double-quoted one, and the sender can choose to quote or not as required. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5547-push-quarantine.sh')
0 files changed, 0 insertions, 0 deletions