mirror of
https://github.com/git/git.git
synced 2026-04-09 16:30:38 +02:00
Change check_ref_format() to take a flags argument
Change check_ref_format() to take a flags argument that indicates what is acceptable in the reference name (analogous to "git check-ref-format"'s "--allow-onelevel" and "--refspec-pattern"). This is more convenient for callers and also fixes a failure in the test suite (and likely elsewhere in the code) by enabling "onelevel" and "refspec-pattern" to be allowed independently of each other. Also rename check_ref_format() to check_refname_format() to make it obvious that it deals with refnames rather than references themselves. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
9224b73be0
commit
8d9c50105f
@@ -54,7 +54,7 @@ def valid_git_ref (ref_name):
|
||||
# The following is a reimplementation of the git check-ref-format
|
||||
# command. The rules were derived from the git check-ref-format(1)
|
||||
# manual page. This code should be replaced by a call to
|
||||
# check_ref_format() in the git library, when such is available.
|
||||
# check_refname_format() in the git library, when such is available.
|
||||
if ref_name.endswith('/') or \
|
||||
ref_name.startswith('.') or \
|
||||
ref_name.count('/.') or \
|
||||
|
||||
Reference in New Issue
Block a user