DoesLocalBranchExist: Handle packed-refs correctly.
Currently, DoesLocalBranchExist relies on some internals of git but it
is incorrect in doing so. It assumes that local branch refs are always
stored unpacked, but this may be false if a GC was just run.
I have also combined DoesLocalBranchExist and DoesCommitExistInRepo,
since DoesCommitExistInRepo was unused.
BUG=chromium:368033
TEST=All unit tests.
TEST=git grep for these two functions.
TEST=x86-mario-paladin --buildbot --debug trybot run.
Change-Id: I3f1755c00f26f9ef35b89ea0f351e707512db2ff
Reviewed-on: https://chromium-review.googlesource.com/197434
Reviewed-by: David James <davidjames@chromium.org>
Commit-Queue: David James <davidjames@chromium.org>
Tested-by: David James <davidjames@chromium.org>
diff --git a/scripts/cbuildbot.py b/scripts/cbuildbot.py
index 025d6c7..25ab8e7 100644
--- a/scripts/cbuildbot.py
+++ b/scripts/cbuildbot.py
@@ -900,7 +900,7 @@
else:
local_branch = branch
- if local_branch and git.DoesLocalBranchExist(project_dir, local_branch):
+ if local_branch and git.DoesCommitExistInRepo(project_dir, local_branch):
verified_patches.append('%s:%s' % (project, local_branch))
ok = True