Allow 'main' as a local main branch name.
Avoiding 'master' as a local branch name per naming guidelines hits this
special case and won't allow upload of child branches. Even though more
comprehensive efforts (crbug.com/1095735) have yet to decide on an
official preferred main branch name this change is small and unlikely
to break things (I hope).
This supports people using a "git pull" "merge" workflow.
Change-Id: I8aca044aeb4178c6671e3a1590617f666505b42e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2377189
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
Auto-Submit: Glen Robertson <glenrob@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 90ebae0..d6ab3ef 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2360,6 +2360,8 @@
if upstream_branch_name == 'master':
return self.GetCommonAncestorWithUpstream()
+ if upstream_branch_name == 'main':
+ return self.GetCommonAncestorWithUpstream()
# Check the squashed hash of the parent.
# TODO(tandrii): consider checking parent change in Gerrit and using its