[git-freeze] Ignore submodules when freezing.

It turns out we are already parsing the full output of `git status`,
so we may as well use that. This output already ignores submodules.

This also updates the freeze implementation to avoid unnecessary
calls to `git commit` when we already know if they are needed or
not.

Note that `git stash` (which `git freeze` is emulating) already
ignores submodules as well.

Ignoring submodules while freezing should make `git rebase-update`
work again inside of repos which have dirty submodules.

R=gavinmak,jojwang

Change-Id: Ib3a7784b6e7e7c19687203c1f4c32422a49bf8e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4680288
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
This commit is contained in:
Robert Iannucci
2023-07-13 19:51:33 +00:00
committed by LUCI CQ
parent 8b44f5d426
commit 4e87f5bfe2
2 changed files with 39 additions and 28 deletions

View File

@@ -3,8 +3,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import sys
import optparse
@@ -12,6 +10,7 @@ import subcommand
from git_common import freeze, thaw
def CMDfreeze(parser, args):
"""Freeze a branch's changes."""
parser.parse_args(args)