diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-03-20 23:34:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-22 23:46:17 -0700 |
commit | 46220ca100cfbcdd7d80a5ac3326c52a3e98dddb (patch) | |
tree | 1be191714a19aedb740a34e9ac838fe54f3cf34e /ll-merge.h | |
parent | fast-import: Document the effect of "merge" with no "from" in a commit (diff) | |
download | tgif-46220ca100cfbcdd7d80a5ac3326c52a3e98dddb.tar.xz |
remote.c: Fix overtight refspec validation
We tightened the refspec validation code in an earlier commit ef00d15
(Tighten refspec processing, 2008-03-17) per my suggestion, but the
suggestion was misguided to begin with and it broke this usage:
$ git push origin HEAD~12:master
The syntax of push refspecs and fetch refspecs are similar in that they
are both colon separated LHS and RHS (possibly prefixed with a + to
force), but the similarity ends there. For example, LHS in a push refspec
can be anything that evaluates to a valid object name at runtime (except
when colon and RHS is missing, or it is a glob), while it must be a
valid-looking refname in a fetch refspec. To validate them correctly, the
caller needs to be able to say which kind of refspecs they are. It is
unreasonable to keep a single interface that cannot tell which kind it is
dealing with, and ask it to behave sensibly.
This commit separates the parsing of the two into different functions, and
clarifies the code to implement the parsing proper (i.e. splitting into
two parts, making sure both sides are wildcard or neither side is).
This happens to also allow pushing a commit named with the esoteric "look
for that string" syntax:
$ git push ../test.git ':/remote.c: Fix overtight refspec:master'
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'll-merge.h')
0 files changed, 0 insertions, 0 deletions