1. 22 Jan, 2019 1 commit
  2. 25 Sep, 2018 1 commit
  3. 12 Sep, 2018 1 commit
    • path validation: `char` is not signed by default. · 44291868
      ARM treats its `char` type as `unsigned type` by default; as a result,
      testing a `char` value as being `< 0` is always false.  This is a
      warning on ARM, which is promoted to an error given our use of
      `-Werror`.
      
      Per ISO 9899:199, section "6.2.5 Types":
      
      > The three types char, signed char, and unsigned char are collectively
      > called the character types. The implementation shall define char to
      > have the same range, representation, and behavior as either signed
      > char or unsigned char.
      >
      ...
      
      > Irrespective of the choice made, char is a separate type from the other
      > two and is not compatible with either.
      Edward Thomson committed
  4. 10 Jun, 2018 1 commit
  5. 01 Jun, 2018 1 commit
    • path: unify `git_path_is_*` APIs · 92159bd4
      Right now, there's quite a lot of different function calls to determine
      whether a path component matches a specific name after normalization
      from the filesystem. We have a function for each of {gitattributes,
      gitmodules, gitignore} multiplicated with {generic, NTFS, HFS} checks.
      In the long time, this is unmaintainable in case there are e.g. new
      filesystems with specific semantics, blowing up the number of functions
      we need to implement.
      
      Replace all functions with a simple `git_path_is_gitfile` function,
      which accepts an enum pointing out the filename that is to be checked
      against as well as the filesystem normalizations to check for. This
      greatly simplifies implementation at the expense of the caller having to
      invoke a somewhat longer function call.
      Patrick Steinhardt committed
  6. 23 May, 2018 2 commits
  7. 22 May, 2018 2 commits
  8. 18 May, 2018 4 commits
  9. 03 Jul, 2017 1 commit
    • Make sure to always include "common.h" first · 0c7f49dd
      Next to including several files, our "common.h" header also declares
      various macros which are then used throughout the project. As such, we
      have to make sure to always include this file first in all
      implementation files. Otherwise, we might encounter problems or even
      silent behavioural differences due to macros or defines not being
      defined as they should be. So in fact, our header and implementation
      files should make sure to always include "common.h" first.
      
      This commit does so by establishing a common include pattern. Header
      files inside of "src" will now always include "common.h" as its first
      other file, separated by a newline from all the other includes to make
      it stand out as special. There are two cases for the implementation
      files. If they do have a matching header file, they will always include
      this one first, leading to "common.h" being transitively included as
      first file. If they do not have a matching header file, they instead
      include "common.h" as first file themselves.
      
      This fixes the outlined problems and will become our standard practice
      for header and source files inside of the "src/" from now on.
      Patrick Steinhardt committed
  10. 08 Jun, 2017 1 commit
  11. 04 Apr, 2017 2 commits
  12. 08 Feb, 2017 3 commits
    • path: ensure dirname on Win32 prefix always has a trailing '/' · 9e8d75c7
      When calling `git_path_dirname_r` on a Win32 prefix, e.g. a drive
      or network share prefix, we always want to return the trailing
      '/'. This does not work currently when passing in a path like
      'C:', where the '/' would not be appended correctly.
      
      Fix this by appending a '/' if we try to normalize a Win32 prefix
      and there is no trailing '/'.
      Patrick Steinhardt committed
    • path: get correct dirname for Windows root · 5d59520c
      Getting the dirname of a filesystem root should return the filesystem
      root itself. E.g. the dirname of "/" is always "/". On Windows, we
      emulate this behavior and as such, we should return e.g. "C:/" if
      calling dirname on "C:/". But we currently fail to do so and instead
      return ".", as we do not check if we actually have a Windows prefix
      before stripping off the last directory component.
      
      Fix this by calling out to `win32_prefix_length` immediately after
      stripping trailing slashes, returning early if we have a prefix.
      Patrick Steinhardt committed
    • path: extract `win32_path_prefix` function · d8c06070
      Extract code which determines if a path is at a Windows system's root.
      This incluses drive prefixes (e.g. "C:\") as well as network computer
      names (e.g. "//computername/").
      Patrick Steinhardt committed
  13. 29 Dec, 2016 1 commit
  14. 12 Dec, 2016 1 commit
  15. 14 Nov, 2016 2 commits
  16. 26 May, 2016 1 commit
  17. 24 Mar, 2016 1 commit
  18. 23 Feb, 2016 1 commit
  19. 17 Feb, 2016 1 commit
    • index: allow read of index w/ illegal entries · 318b825e
      Allow `git_index_read` to handle reading existing indexes with
      illegal entries.  Allow the low-level `git_index_add` to add
      properly formed `git_index_entry`s even if they contain paths
      that would be illegal for the current filesystem (eg, `AUX`).
      Continue to disallow `git_index_add_bypath` from adding entries
      that are illegal universally illegal (eg, `.git`, `foo/../bar`).
      Edward Thomson committed
  20. 15 Dec, 2015 1 commit
  21. 17 Sep, 2015 1 commit
  22. 13 Sep, 2015 2 commits
  23. 05 Aug, 2015 1 commit
  24. 22 Jul, 2015 1 commit
  25. 13 Jul, 2015 1 commit
  26. 24 Jun, 2015 1 commit
    • buffer: don't allow growing borrowed buffers · caab22c0
      When we don't own a buffer (asize=0) we currently allow the usage of
      grow to copy the memory into a buffer we do own. This muddles the
      meaning of grow, and lets us be a bit cavalier with ownership semantics.
      
      Don't allow this any more. Usage of grow should be restricted to buffers
      which we know own their own memory. If unsure, we must not attempt to
      modify it.
      Carlos Martín Nieto committed
  27. 17 Jun, 2015 1 commit
  28. 15 Jun, 2015 2 commits
  29. 12 Jun, 2015 1 commit