Handle branch or commit refs in the url for unmanaged git solutions

This allows having a git repo cloned on a specific branch or commit, similar to
what's possible for svn solutions by specifying a url like svnrepo/branches/foo

Having the possibility to check the code out on a specific branch makes the
initial code checkout workflow simpler, and allows specifying all the relevant
info directly in the fetch recipe, instead of  having to deal with branches
manually afterwards (which is the whole purpose of recipes in the first place)

So with this change, I'm able to do the following in my custom fetch recipe:

    solution = {
        'name' : 'src',
        'url' : 'git@github.snei.sony.com:SNEI/chromium.git@refs/heads/custombranch',
        <following lines skipped>

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@273675 0039d316-1c4b-4281-b951-d872f2087c98
2 files changed
tree: 2035742f81a2f1d01411fbfcca21016cc48494cb
  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-cache
  55. git-cl
  56. git-cl-upload-hook
  57. git-crsync
  58. git-crup
  59. git-freeze
  60. git-gs
  61. git-lkgr
  62. git-map
  63. git-map-branches
  64. git-mark-merge-base
  65. git-nav-downstream
  66. git-nav-upstream
  67. git-new-branch
  68. git-number
  69. git-rebase-update
  70. git-rename-branch
  71. git-reparent-branch
  72. git-runhooks
  73. git-squash-branch
  74. git-thaw
  75. git-try
  76. git-upstream-diff
  77. git_cache.py
  78. git_cl.py
  79. git_common.py
  80. git_freezer.py
  81. git_map.py
  82. git_map_branches.py
  83. git_mark_merge_base.py
  84. git_nav_downstream.py
  85. git_new_branch.py
  86. git_number.py
  87. git_rebase_update.py
  88. git_rename_branch.py
  89. git_reparent_branch.py
  90. git_squash_branch.py
  91. git_try.py
  92. git_upstream_diff.py
  93. gn
  94. gn.bat
  95. gn.py
  96. hammer
  97. hammer.bat
  98. LICENSE
  99. my_activity.py
  100. my_reviews.py
  101. ninja
  102. ninja-linux32
  103. ninja-linux64
  104. ninja-mac
  105. ninja.exe
  106. OWNERS
  107. owners.py
  108. owners_finder.py
  109. patch.py
  110. PRESUBMIT.py
  111. presubmit_canned_checks.py
  112. presubmit_support.py
  113. profile.xml
  114. pylint
  115. pylint.py
  116. pylintrc
  117. python_git_runner.sh
  118. README
  119. README.codereview
  120. README.gclient
  121. README.git-cl
  122. README.testing
  123. repo
  124. rietveld.py
  125. scm.py
  126. subcommand.py
  127. subprocess2.py
  128. trychange.py
  129. update_depot_tools
  130. update_depot_tools.bat
  131. upload_to_google_storage.py
  132. WATCHLISTS
  133. watchlists.py
  134. weekly
  135. wtf