Add upstream parameter when building an owners client.
code-owners plugins wants a git ref in Gerrit (e.g. refs/heads/master)
while Depot Tools wants a local git ref (e.g. refs/remotes/origin/main,
or a git hash).
Add an upstream parameters to be used by Depot Tools, separate from
a Gerrit ref expected by owners_client.
Change-Id: Ieed97a186e3140b3f82830efa189dbe3e4d8c806
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2730049
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
diff --git a/git_cl.py b/git_cl.py
index e6d2030..3bf80cb 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -993,6 +993,7 @@
branch = GetTargetRef(remote, remote_branch, None)
self._owners_client = owners_client.GetCodeOwnersClient(
root=settings.GetRoot(),
+ upstream=self.GetCommonAncestorWithUpstream(),
host=self.GetGerritHost(),
project=self.GetGerritProject(),
branch=branch)