Chromium Code Reviews| Index: gclient_scm.py |
| diff --git a/gclient_scm.py b/gclient_scm.py |
| index 594515dc16879c9014cd007a11754b6f86f6028e..b1308726de4acfcb0539fa070bd25d800aafd0ee 100644 |
| --- a/gclient_scm.py |
| +++ b/gclient_scm.py |
| @@ -331,7 +331,9 @@ class GitWrapper(SCMWrapper): |
| # Override the revision number. |
| revision = str(options.revision) |
| if revision == 'unmanaged': |
| - revision = None |
| + # Check again for a revision in case an initial ref was specified in the url, |
|
iannucci
2014/05/23 18:06:58
80 cols?
Romain Pokrzywka
2014/05/23 21:15:45
indeed, will fix
|
| + # for example bla.git@refs/heads/custombranch |
| + url, revision = gclient_utils.SplitUrlRevision(self.url) |
|
iannucci
2014/05/23 18:06:58
isn't this this same as
revision = deps_revision
Romain Pokrzywka
2014/05/23 21:15:45
Correct, thanks for catching that. The second call
|
| managed = False |
| if not revision: |
| revision = default_rev |
| @@ -819,12 +821,10 @@ class GitWrapper(SCMWrapper): |
| if os.listdir(tmp_dir): |
| self.Print('_____ removing non-empty tmp dir %s' % tmp_dir) |
| gclient_utils.rmtree(tmp_dir) |
| - if revision.startswith('refs/heads/'): |
| - self._Run( |
| - ['checkout', '--quiet', revision.replace('refs/heads/', '')], options) |
| - else: |
| + self._Run(['checkout', '--quiet', revision.replace('refs/heads/', '')], |
|
iannucci
2014/05/23 18:06:58
tbh, this '--quiet' option can be problematic, esp
Romain Pokrzywka
2014/05/23 21:15:45
Fine with me. That said I feel this isn't directly
iannucci
2014/05/23 21:17:49
Yep that's fine, I was just musing :)
|
| + options) |
| + if self._GetCurrentBranch() is None: |
| # Squelch git's very verbose detached HEAD warning and use our own |
| - self._Run(['checkout', '--quiet', revision], options) |
| self.Print( |
| ('Checked out %s to a detached HEAD. Before making any commits\n' |
| 'in this repo, you should use \'git checkout <branch>\' to switch to\n' |