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/+/2150507
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Auto-Submit: Andrew Grieve <agrieve@chromium.org>
changes/07/2150507/3
Andrew Grieve 5 years ago committed by LUCI CQ
parent e1a9c8db7e
commit fc5e103221

@ -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

Loading…
Cancel
Save