summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index a7518b6f0d..d3db15a76c 100644
--- a/refs.c
+++ b/refs.c
@@ -698,7 +698,6 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
{
struct strbuf real_pattern = STRBUF_INIT;
struct ref_filter filter;
- const char *has_glob_specials;
int ret;
if (!prefix && prefixcmp(pattern, "refs/"))
@@ -707,8 +706,7 @@ int for_each_glob_ref_in(each_ref_fn fn, const char *pattern,
strbuf_addstr(&real_pattern, prefix);
strbuf_addstr(&real_pattern, pattern);
- has_glob_specials = strpbrk(pattern, "?*[");
- if (!has_glob_specials) {
+ if (!has_glob_specials(pattern)) {
/* Append implied '/' '*' if not present. */
if (real_pattern.buf[real_pattern.len - 1] != '/')
strbuf_addch(&real_pattern, '/');
@@ -1278,6 +1276,7 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
if (log_all_ref_updates &&
(!prefixcmp(ref_name, "refs/heads/") ||
!prefixcmp(ref_name, "refs/remotes/") ||
+ !prefixcmp(ref_name, "refs/notes/") ||
!strcmp(ref_name, "HEAD"))) {
if (safe_create_leading_directories(log_file) < 0)
return error("unable to create directory for %s",