1. 13 Jun, 2019 5 commits
    • attr_file: remove invalid TODO comment · 3b517351
      In our attributes pattern parsing code, we have a comment that
      states we might have to convert '\' characters to '/' to have
      proper POSIX paths. But in fact, '\' characters are valid inside
      the string and act as escape mechanism for various characters,
      which is why we never want to convert those to POSIX directory
      separators. Furthermore, gitignore patterns are specified to only
      treat '/' as directory separators.
      
      Remove the comment to avoid future confusion.
      Patrick Steinhardt committed
    • attr_file: account for escaped escapes when searching trailing space · b3b6a39d
      When determining the trailing space length, we need to honor
      whether spaces are escaped or not. Currently, we do not check
      whether the escape itself is escaped, though, which might
      generate an off-by-one in that case as we will simply treat the
      space as escaped.
      
      Fix this by checking whether the backslashes preceding the space
      are themselves escaped.
      Patrick Steinhardt committed
    • attr_file: fix unescaping of escapes required for fnmatch · 10ac298c
      When parsing attribute patterns, we will eventually unescape the
      parsed pattern. This is required because we require custom
      escapes for whitespace characters, as normally they are used to
      terminate the current pattern. Thing is, we don't only unescape
      those whitespace characters, but in fact all escaped sequences.
      So for example if the pattern was "\*", we unescape that to "*".
      As this is directly passed to fnmatch(3) later, fnmatch would
      treat it as a simple glob matching all files where it should
      instead only match a file with name "*".
      
      Fix the issue by unescaping spaces, only. Add a bunch of tests to
      exercise escape parsing.
      Patrick Steinhardt committed
    • attr_file: properly handle escaped '\' when searching non-escaped spaces · eb146e58
      When parsing attributes, we need to search for the first
      unescaped whitespace character to determine where the pattern is
      to be cut off. The scan fails to account for the case where the
      escaping '\' character is itself escaped, though, and thus we
      would not recognize the cut-off point in patterns like "\\ ".
      
      Refactor the scanning loop to remember whether the last character
      was an escape character. If it was and the next character is a
      '\', too, then we will reset to non-escaped mode again. Thus, we
      now handle escaped whitespaces as well as escaped wildcards
      correctly.
      Patrick Steinhardt committed
    • path: only treat paths starting with '\' as absolute on Win32 · f7c6795f
      Windows-based systems treat paths starting with '\' as absolute,
      either referring to the current drive's root (e.g. "\foo" might
      refer to "C:\foo") or to a network path (e.g. "\\host\foo"). On
      the other hand, (most?) systems that are not based on Win32
      accept backslashes as valid characters that may be part of the
      filename, and thus we cannot treat them to identify absolute
      paths.
      
      Change the logic to only paths starting with '\' as absolute on
      the Win32 platform. Add tests to avoid regressions and document
      behaviour.
      Patrick Steinhardt committed
  2. 07 Jun, 2019 2 commits
    • tests: unify ignore tests into their own dir · 01dda5ff
      We had several occasions where tests for the gitignore had been
      added to status::ignore instead of the easier-to-handle
      attr::ignore test suite. This most likely resulted from the fact
      that the attr::ignore test suite is not easy to discover inside
      of the attr folder. Furthermore, ignore being part of the
      attributes code is an implementation detail, only, and thus
      shouldn't be stressed as much.
      
      Improve this by moving both attr::ignore and status::ignore tests
      into a new ignore test suite.
      Patrick Steinhardt committed
    • tests: remove accidentally checked in backup file · 65ad6b5a
      The "ignore.c.bak" file has accidentally been checked in via
      commit 19164901 (ignore: test that leading whitespace is
      significant, 2019-05-19) and should obviously not be part of our
      test suites. Delete it.
      Patrick Steinhardt committed
  3. 06 Jun, 2019 4 commits
  4. 05 Jun, 2019 3 commits
  5. 24 May, 2019 11 commits
  6. 23 May, 2019 1 commit
  7. 22 May, 2019 8 commits
  8. 21 May, 2019 6 commits