DescriptionDon't have checkout.py's git apply_patch fail when files don't match
The contract for apply_patch is that it applies a patch on top of something, and
it either all applies cleanly or it fails. The something that is applied on can
be as clean or dirty without having apply_patch judge. The particular failure
condition was that we want to patch DEPS first (into the index), do some stuff,
then apply another patch on top of that. Apply_patch was failing because it
saw that there was a DEPS in the index already when it wasn't expecting one.
A fix that could've also worked is to run git diff --staged before applying the
patch, then subtract that list from found_files, but it still gets tricky then
because what if you want to apply an independent patch on top of
an already patched index?
Because apply_patch shouldn't need to be in the business of
keeping track of what the state of everything is like before and
after a patch (That's up to the patch application), the better thing would be to remove the assert
alltogether, and rely on "git apply" to complain if something doesn't apply.
BUG=370503
TBR=iannucci
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=269526
Patch Set 1 #
Total comments: 2
Messages
Total messages: 6 (0 generated)
|