summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c67b1fa)
raw | patch | inline | side by side (parent: c67b1fa)
author | Björn Steinbrink <B.Steinbrink@gmx.de> | |
Thu, 28 Aug 2008 02:14:02 +0000 (04:14 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 29 Aug 2008 07:14:06 +0000 (00:14 -0700) |
More often than not, I end up using something like refs/remotes/ as the
pattern for for-each-ref, but that doesn't work, because it expects to see
the slash in the ref name right after the matched pattern. So teach it to
accept the slash as the final character in the pattern as well.
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pattern for for-each-ref, but that doesn't work, because it expects to see
the slash in the ref name right after the matched pattern. So teach it to
accept the slash as the final character in the pattern as well.
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-for-each-ref.c | patch | blob | history |
diff --git a/builtin-for-each-ref.c b/builtin-for-each-ref.c
index 4d25ec51d009bf18f95c60ca9ccd641ac5792db6..21e92bbcb577c0361df51bd81e6fb5ab546619ea 100644 (file)
--- a/builtin-for-each-ref.c
+++ b/builtin-for-each-ref.c
@@ -652,7 +652,8 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
if ((plen <= namelen) &&
!strncmp(refname, p, plen) &&
(refname[plen] == '\0' ||
- refname[plen] == '/'))
+ refname[plen] == '/' ||
+ p[plen-1] == '/'))
break;
if (!fnmatch(p, refname, FNM_PATHNAME))
break;