diff options
author | Mike Frysinger <vapier@google.com> | 2021-02-27 21:27:04 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-02-28 16:07:24 +0000 |
commit | 6d1faa1db35439b267a7b10725ab0876f027ecb6 (patch) | |
tree | ef27ef693f564a8f342d22450c22fe564e0edf48 /subcmds/download.py | |
parent | 4510be51c1e4852258dd97fb043a250a6e3abfc7 (diff) | |
download | git-repo-6d1faa1db35439b267a7b10725ab0876f027ecb6.tar.gz |
git_refs: fix crash with binary . files in .git/refs/
On macOS, the Finder app likes to poop .DS_Store files in every path
that the user browses. If the user pokes around the .git/ tree, it
could generate a .DS_Store file in there too. When repo goes to read
all the local refs, it tries to decode this binary file as UTF-8 and
subsequently crashes.
Since paths that begin with . are not valid refs, ignore them like we
already do with paths that end in .lock. Also bump the check up to
ignore dirs that match since that follows the git rules: they apply
to any component in its path, not just the final path (name).
We don't implement the full valid ref algorithm that git employs as
it's a bit complicated, and we only really need to focus on what will
practically show up locally.
Bug: https://crbug.com/gerrit/14162
Change-Id: I6519f990e33cc58a72fcb00c0f983ad3285ace3d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/298662
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Michael Mortensen <mmortensen@google.com>
Diffstat (limited to 'subcmds/download.py')
0 files changed, 0 insertions, 0 deletions