mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-20 16:14:25 +00:00
Convert prompt answers to lower case before checking
When prompting for yes/no answers, convert the answer to lower case before comparing. This makes it easier to catch answers like "Yes", "yes", and "YES" with a comparison only for "yes". Change-Id: I06da8281cec81a7438ebb46ddaf3344d12abe1eb
This commit is contained in:
parent
9f3406ea46
commit
fc241240d8
@ -248,7 +248,7 @@ to update the working directory files.
|
|||||||
print ''
|
print ''
|
||||||
print 'Your identity is: %s <%s>' % (name, email)
|
print 'Your identity is: %s <%s>' % (name, email)
|
||||||
sys.stdout.write('is this correct [y/N]? ')
|
sys.stdout.write('is this correct [y/N]? ')
|
||||||
a = sys.stdin.readline().strip()
|
a = sys.stdin.readline().strip().lower()
|
||||||
if a in ('yes', 'y', 't', 'true'):
|
if a in ('yes', 'y', 't', 'true'):
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -186,8 +186,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
|
|||||||
print ' %s' % commit
|
print ' %s' % commit
|
||||||
|
|
||||||
sys.stdout.write('to %s (y/N)? ' % remote.review)
|
sys.stdout.write('to %s (y/N)? ' % remote.review)
|
||||||
answer = sys.stdin.readline().strip()
|
answer = sys.stdin.readline().strip().lower()
|
||||||
answer = answer in ('y', 'Y', 'yes', '1', 'true', 't')
|
answer = answer in ('y', 'yes', '1', 'true', 't')
|
||||||
|
|
||||||
if answer:
|
if answer:
|
||||||
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
|
if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD:
|
||||||
|
Loading…
Reference in New Issue
Block a user