mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-10 18:21:28 +00:00
On Windows, the command line has a character limit of 8191. When checking for commit objects in submodules, the `git ls-tree` command can become very long if many files are affected, potentially exceeding this limit. This change modifies `CheckForCommitObjects` to check the estimated length of the `git ls-tree` command when running on Windows. If the command line with all affected files would exceed the limit, it falls back to using a recursive `ls-tree` (`-r`) instead of listing each file individually. This prevents command line overflow errors on Windows. Change-Id: I6a340baefee57f5933473add0601a42ff1e61bb6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7254474 Auto-Submit: Josiah Kiehl <kiehl@google.com> Commit-Queue: Josiah Kiehl <kiehl@google.com> Reviewed-by: Yiwei Zhang <yiwzhang@google.com>