1
0
mirror of https://github.com/golang/go synced 2024-11-21 17:54:39 -07:00

codereview: avoid exception in match

R=rsc
CC=golang-dev
https://golang.org/cl/1585041
This commit is contained in:
Paolo Giarrusso 2010-06-09 21:37:11 -07:00 committed by Russ Cox
parent 19783ef482
commit 3ca72458ec

View File

@ -659,6 +659,7 @@ original_match = None
def ReplacementForCmdutilMatch(repo, pats=[], opts={}, globbed=False, default='relpath'): def ReplacementForCmdutilMatch(repo, pats=[], opts={}, globbed=False, default='relpath'):
taken = [] taken = []
files = [] files = []
pats = pats or []
for p in pats: for p in pats:
if p.startswith('@'): if p.startswith('@'):
taken.append(p) taken.append(p)