Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: sky/tools/webkitpy/common/checkout/scm/git.py

Issue 948663002: Make webkit-patch pretty-diff do the right thing for upstream branchs. (Closed) Base URL: git@github.com:domokit/mojo.git@staticposition
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/webkitpy/common/checkout/scm/git.py
diff --git a/sky/tools/webkitpy/common/checkout/scm/git.py b/sky/tools/webkitpy/common/checkout/scm/git.py
index 9f0571880a02f5a4941af7ca510ed2cf991cc996..909bd8ccd1141df0c6b11d7e7a74f8ab3c85ffda 100644
--- a/sky/tools/webkitpy/common/checkout/scm/git.py
+++ b/sky/tools/webkitpy/common/checkout/scm/git.py
@@ -138,6 +138,9 @@ class Git(SCM):
def _upstream_branch(self):
current_branch = self.current_branch()
+ # If the remote is pointing to something other than "." than the upstream branch isn't a local branch.
+ if self.read_git_config('branch.%s.remote' % current_branch, cwd=self.checkout_root, executive=self._executive) != ".":
+ return None
return self._branch_from_ref(self.read_git_config('branch.%s.merge' % current_branch, cwd=self.checkout_root, executive=self._executive).strip())
def _merge_base(self, git_commit=None):
@@ -157,6 +160,10 @@ class Git(SCM):
git_commit = git_commit + "^.." + git_commit
return git_commit
+ upstream = self._upstream_branch()
+ if upstream:
+ return upstream
+
return self._remote_merge_base()
def changed_files(self, git_commit=None):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698