[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>
diff --git a/git_freezer.py b/git_freezer.py
index c0f73c3..afcfb75 100755
--- a/git_freezer.py
+++ b/git_freezer.py
@@ -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 @@
 
 from git_common import freeze, thaw
 
+
 def CMDfreeze(parser, args):
   """Freeze a branch's changes."""
   parser.parse_args(args)