From: Rafael Ascensão Date: Mon, 06 Nov 2017 02:37:55 GMT Subject: Re: [PATCH v1 1/2] refs: extract function to normalize partial refs Message-ID: <4b0fd3ff-3331-14be-2478-03f44ae3b0a9@gmail.com> In-Reply-To: On 06/11/17 01:23, Junio C Hamano wrote: > Michael Haggerty writes: > >> [1] I say "almost entirely" because putting them in one function means >> that only `pattern` needs to be scanned for glob characters. But that is >> an unimportant detail. > > That could actually be an important detail, in that even if prefix > has wildcard, we'd still append the trailing "/*" as long as the > pattern does not, right? > > So the interface might be simplified by having two functions, > > void normalize_glob_ref(normalized_pattern, prefix, pattern); > void ensure_blob(struct strbuf *pattern); I think that flag no longer makes sense. I added it just to allow '--decorate-refs' work with "exact patterns". And since that has the ugly side effect of losing the ability to use "shortcut patterns" like 'tags' to refer to 'refs/tags/*', I believe it's a good idea to remove it.