Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating regex pattern to handle unicode whitespaces. #1853

Commits on Mar 1, 2024

  1. Updating regex pattern to handle unicode whitespaces.

    Replacing the \s whitespace characters with normal spaces (" ") to prevent breaking on unicode whitespace characters (e.g., NBSP). Without this, if a branch name contains a unicode whitespace character that falls under \s, then the branch name will be truncated.
    jcole-crowdstrike committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    5ca0fba View commit details
    Browse the repository at this point in the history
  2. Updating spacing per linting test.

    Adding a second blank line after the newly added test case.
    jcole-crowdstrike committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    827e986 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2024

  1. Fixing Windows encoding issue.

    Stdout is being encoded as Windows-1251 instead of UTF-8 due to passing
    universal_newlines as True to subprocess.
    jcole-crowdstrike committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    4810491 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

  1. Setting universal_newlines=False explicitly in fetch() and pull().

    This fix avoids encoding problems on Windows, as was done for fetch() in the previous commit. However, here it is being made more explicit and adds the same fix for the pull function.
    jcole-crowdstrike committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    938f272 View commit details
    Browse the repository at this point in the history
  2. Fixing stripping issue causing passing tests to be interpreted as fai…

    …lures
    
    Removing this block of code that strips away nonprintable ASCII characters, as it is causing some tests to fail inappropriately.
    
    Successful tests are identified by the suffix ", done", which is being removed from some messages due to this aforementioned block of code. The codeblock probably intends to just strip away traililng non-ASCII characters from strings, but does not break, and so will instead continue to iterate through the string and then strip away both printable/nonprintable ASCII; this is causing the loss of the ", done" because anytime a nonprintable character is anywhere but the end of the string then the entire section of string after the character is truncated.
    
    Looking back through commits, this codeblock was added in 882ebb1 as a workaround after the addition of universal_newlines. Seeing as we have removed universal_newlines in the previous commit, we can also remove this codeblock.
    
    In future, if something likw this is needed, then maybe a join that concatenates all printable ASCII characters would serve better (e.g., "".join(b for b in line if b >= 32)), instead of trying to cut out the nonprintable chars.
    jcole-crowdstrike committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    8b8c76a View commit details
    Browse the repository at this point in the history