Add checks to GitSanityChecks (upstream branch or current branch can be None)

I've run in the exceptions a few times when doing
'git cl presubmit' or 'git cl lint' from a detached
HEAD state (not uncommon when using 'git rebase-update')

Review URL: https://codereview.chromium.org/792933003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@293643 0039d316-1c4b-4281-b951-d872f2087c98
2 files changed
tree: bdc785bb5548c8a92cbcab2fb6125ba95faa0b21
  1. bootstrap/
  2. git-templates/
  3. git_utils/
  4. man/
  5. recipes/
  6. support/
  7. testing_support/
  8. tests/
  9. third_party/
  10. win_toolchain/
  11. zsh-goodies/
  12. .gitignore
  13. annotated_gclient.py
  14. apply_issue
  15. apply_issue.bat
  16. apply_issue.py
  17. breakpad.py
  18. checkout.py
  19. chrome-update-create-task.bat
  20. chrome-update.bat
  21. chrome-update.py
  22. clang-format
  23. clang-format.bat
  24. clang_format.py
  25. codereview.settings
  26. commit_queue.py
  27. cpplint.bat
  28. cpplint.py
  29. cpplint_chromium.py
  30. create-chromium-git-src
  31. create-ntfs-junction.c
  32. create-ntfs-junction.exe
  33. download_from_google_storage
  34. download_from_google_storage.bat
  35. download_from_google_storage.py
  36. drover
  37. drover.bat
  38. drover.py
  39. fetch
  40. fetch.bat
  41. fetch.py
  42. fix_encoding.py
  43. gcl
  44. gcl.bat
  45. gcl.py
  46. gclient
  47. gclient-new-workdir.py
  48. gclient.bat
  49. gclient.py
  50. gclient_completion.sh
  51. gclient_scm.py
  52. gclient_utils.py
  53. gerrit_util.py
  54. git-auto-svn
  55. git-cache
  56. git-cherry-pick-upload
  57. git-cl
  58. git-cl-upload-hook
  59. git-crsync
  60. git-crup
  61. git-footers
  62. git-freeze
  63. git-gs
  64. git-lkgr
  65. git-map
  66. git-map-branches
  67. git-mark-merge-base
  68. git-nav-downstream
  69. git-nav-upstream
  70. git-new-branch
  71. git-number
  72. git-rebase-update
  73. git-rename-branch
  74. git-reparent-branch
  75. git-retry
  76. git-runhooks
  77. git-squash-branch
  78. git-thaw
  79. git-try
  80. git-upstream-diff
  81. git_auto_svn.py
  82. git_cache.py
  83. git_cherry_pick_upload.py
  84. git_cl.py
  85. git_common.py
  86. git_footers.py
  87. git_freezer.py
  88. git_map.py
  89. git_map_branches.py
  90. git_mark_merge_base.py
  91. git_nav_downstream.py
  92. git_new_branch.py
  93. git_number.py
  94. git_rebase_update.py
  95. git_rename_branch.py
  96. git_reparent_branch.py
  97. git_retry.py
  98. git_squash_branch.py
  99. git_try.py
  100. git_upstream_diff.py
  101. gn
  102. gn.bat
  103. gn.py
  104. gsutil.py
  105. hammer
  106. hammer.bat
  107. LICENSE
  108. my_activity.py
  109. my_reviews.py
  110. ninja
  111. ninja-linux32
  112. ninja-linux64
  113. ninja-mac
  114. ninja.exe
  115. OWNERS
  116. owners.py
  117. owners_finder.py
  118. patch.py
  119. PRESUBMIT.py
  120. presubmit_canned_checks.py
  121. presubmit_support.py
  122. profile.xml
  123. pylint
  124. pylint.py
  125. pylintrc
  126. python_git_runner.sh
  127. README
  128. README.codereview
  129. README.gclient
  130. README.git-cl
  131. README.testing
  132. repo
  133. rietveld.py
  134. roll-dep
  135. roll-dep.bat
  136. roll_dep.py
  137. scm.py
  138. subcommand.py
  139. subprocess2.py
  140. trychange.py
  141. update_depot_tools
  142. update_depot_tools.bat
  143. upload_to_google_storage.py
  144. WATCHLISTS
  145. watchlists.py
  146. weekly
  147. wtf