diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-11-14 09:19:39 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-11-14 09:19:39 +0900 |
commit | fc241240d828d7e8302dc0876608a9d27ae1cbc7 (patch) | |
tree | 83936a7c4dde92e5ccffb9d884591f633f421390 /subcmds/upload.py | |
parent | 9f3406ea4635e0f8cef1d0ec4dbfe6b1554375d6 (diff) | |
download | git-repo-fc241240d828d7e8302dc0876608a9d27ae1cbc7.tar.gz |
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
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r-- | subcmds/upload.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 39721ac2..925652c2 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
@@ -186,8 +186,8 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
186 | print ' %s' % commit | 186 | print ' %s' % commit |
187 | 187 | ||
188 | sys.stdout.write('to %s (y/N)? ' % remote.review) | 188 | sys.stdout.write('to %s (y/N)? ' % remote.review) |
189 | answer = sys.stdin.readline().strip() | 189 | answer = sys.stdin.readline().strip().lower() |
190 | answer = answer in ('y', 'Y', 'yes', '1', 'true', 't') | 190 | answer = answer in ('y', 'yes', '1', 'true', 't') |
191 | 191 | ||
192 | if answer: | 192 | if answer: |
193 | if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD: | 193 | if len(branch.commits) > UNUSUAL_COMMIT_THRESHOLD: |