diff options
Diffstat (limited to 'object-name.c')
-rw-r--r-- | object-name.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/object-name.c b/object-name.c index 88d1313028..f43fdba240 100644 --- a/object-name.c +++ b/object-name.c @@ -2052,12 +2052,14 @@ static enum get_oid_result get_oid_with_context_1(struct repository *repo, return -1; } for (cp = name, bracket_depth = 0; *cp; cp++) { - if (*cp == '{') + if (strchr("@^", *cp) && cp[1] == '{') { + cp++; bracket_depth++; - else if (bracket_depth && *cp == '}') + } else if (bracket_depth && *cp == '}') { bracket_depth--; - else if (!bracket_depth && *cp == ':') + } else if (!bracket_depth && *cp == ':') { break; + } } if (*cp == ':') { struct object_id tree_oid; |