Skip to content

Commit

Permalink
fix: do not attempt to process symlinks (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
hallettj committed Jun 10, 2021
1 parent b31d0af commit ebc6e34
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions git-format-staged
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def format_staged_files(file_patterns, formatter, git_root, update_working_tree=
for line in output.splitlines():
entry = parse_diff(line.decode('utf-8'))
entry_path = normalize_path(entry['src_path'], relative_to=git_root)
if entry['dst_mode'] == '120000':
# Do not process symlinks
continue
if not (matches_some_path(file_patterns, entry_path)):
continue
if format_file_in_index(formatter, entry, update_working_tree=update_working_tree, write=write):
Expand Down

0 comments on commit ebc6e34

Please sign in to comment.