Convert branch revision to remote branch in status call.

We pull the revision from the DEPS url, but if the revision is a branch,  the string must be converted into the local branch names we have for remote branches.

Bug: 1464985
Change-Id: I32c89c947319a04421c46d09d057e42043594e76
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4699021
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 06220ed..67f2031 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -325,6 +325,24 @@
                      'a7142dc9f0009350b96a11f372b6ea658592aa95')
     sys.stdout.close()
 
+  def testStatusRef(self):
+    if not self.enabled:
+      return
+    options = self.Options()
+    file_paths = [join(self.base_path, 'a')]
+    with open(file_paths[0], 'a') as f:
+      f.writelines('touched\n')
+    scm = gclient_scm.GitWrapper(self.url + '@refs/heads/feature',
+                                 self.root_dir, self.relpath)
+    file_paths.append(join(self.base_path, 'c'))  # feature branch touches c
+    file_list = []
+    scm.status(options, self.args, file_list)
+    self.assertEqual(file_list, file_paths)
+    self.checkstdout(
+        ('\n________ running \'git -c core.quotePath=false diff --name-status '
+         'refs/remotes/origin/feature\' in \'%s\'\n\nM\ta\n') %
+        join(self.root_dir, '.'))
+
   def testStatusNew(self):
     if not self.enabled:
       return