Fix multi-rename empty branch detection.
This changes the 'empty' branch detection to compare the commit trees instead
of the commit hashes. This avoids empty-branch detection when you have multiple
renames on the branch that end up canceling eachother out. Previously you'd
end up with the rename-commits, in order, in your rebased branch, even though
when you run `git upstream-diff` you get nothing.
R=agable@chromium.org, jochen@chromium.org, vadimsh@chromium.org
BUG=438208
Review URL: https://codereview.chromium.org/1497313002
git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@297849 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/git_rebase_update.py b/git_rebase_update.py
index 9d5755e..a725207 100755
--- a/git_rebase_update.py
+++ b/git_rebase_update.py
@@ -93,9 +93,9 @@
for branch, parent in git.topo_iter(branch_tree, top_down=False):
downstreams[parent].append(branch)
- # If branch and parent have the same state, then branch has to be marked
+ # If branch and parent have the same tree, then branch has to be marked
# for deletion and its children and grand-children reparented to parent.
- if git.hash_one(branch) == git.hash_one(parent):
+ if git.hash_one(branch+":") == git.hash_one(parent+":"):
ensure_root_checkout()
logging.debug('branch %s merged to %s', branch, parent)