Commit fc5e1032 authored by Andrew Grieve's avatar Andrew Grieve Committed by LUCI CQ

Fix "git freeze" failing on broken symlinks

Fixed by switching "stat()" to "lstat()".

Does not seem to be a python3 vs python2 thing (fails on py2 as well).

Bug: 1071066
Change-Id: I7eea9ed39b43e09ae2f7558bf23c12581f02e4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2150507Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
parent e1a9c8db
......@@ -454,7 +454,7 @@ def freeze():
die("Cannot freeze unmerged changes!")
if limit_mb > 0:
if s.lstat == '?':
untracked_bytes += os.stat(os.path.join(root_path, f)).st_size
untracked_bytes += os.lstat(os.path.join(root_path, f)).st_size
if limit_mb > 0 and untracked_bytes > limit_mb * MB:
die("""\
You appear to have too much untracked+unignored data in your git
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment