1. 20 Oct, 2018 12 commits
    • symlink tests: test symbolic links on windows · da500cc6
      Test updated symbolic link creation on Windows.  Ensure that we emulate
      Git for Windows behavior.  Ensure that when `core.symlinks=true` is set
      in a global configuration that new repositories are created without a
      `core.symlinks` setting, and that when `core.symlinks` is unset that
      `core.symlinks=false` in set in the repository.  Further ensure that
      checkout honors the expected `core.symlinks` defaults on Windows.
      Edward Thomson committed
    • repo::init tests: refactor global config path override · 3f0caa15
      Provide a function that allows tests to set up a bespoke global
      configuration path.
      Edward Thomson committed
    • repository: load_config for non-repo configs · 820e1e93
      Teach `load_config` how to load all the configurations except
      (optionally) the repository configuration.  This allows the new
      repository codepath to load the global/xdg/system configuration paths so
      that they can be inspected during repository initialization.
      Edward Thomson committed
    • win32: emulate Git for Windows in symlink support · b433a22a
      Emulate the Git for Windows `core.symlinks` support.  Since symbolic
      links are generally enabled for Administrator (and _may_ be enabled due
      to enabling Developer mode) but symbolic links are still sufficiently
      uncommon on Windows that Git users are expected to explicitly opt-in to
      symbolic links by enabling `core.symlinks=true` in a global (or xdg or
      system) configuration.
      
      When `core.symlinks=true` is set globally _and_ symbolic links support
      is detected then new repositories created will not have a
      `core.symlinks` set.  If `core.symlinks` is _not_ set then no detection
      will be performed, and `core.symlinks=false` will be set in the
      repository configuration.
      Edward Thomson committed
    • checkout tests: ensure readlink succeeds · df1733de
      Don't try to use `link_size` as an index into a string if `p_readlink`
      returned <0.  That will - obviously - fail and we'll write out of
      bounds.
      Edward Thomson committed
    • repo tests: ensure core.symlinks is set correctly · 8533c80d
      Ensure that `core.symlinks` is set correctly.  By default, it is unset,
      but it is explicitly set to `false` if the platform was detected to not
      support symlinks during repository initialization.
      Edward Thomson committed
    • win32: add symbolic link support · 204cce66
      Enable `p_symlink` to actually create symbolic links, not just create a
      fake link (a text file containing the link target).
      
      This now means that `core.symlinks=true` works on Windows platforms
      where symbolic links are enabled (likely due to running in Developer
      Mode).
      Edward Thomson committed
    • checkout tests: test symlinks based on support, not platform · e4ac4000
      When testing whether symlinks are correctly checked out, examine the
      `core.symlinks` configuration option to determine if symlinks are
      supported in a repository, don't simply assume that Windows means that
      symbolic links are not supported.
      
      Further, when testing the expected default behavior of `core.symlinks`,
      test the filesystem's support to determine if symlinks are supported.
      
      Finally, ensure that `core.symlinks=true` fails on a system where
      symlinks are actually not supported.  This aligns with the behavior of
      Git for Windows.
      Edward Thomson committed
    • checkout tests: don't use GetFinalPathNameByHandle · 7b6875f4
      To determine the canonical filename for a given path, we previously
      looked at the directory entries on POSIX systems and used
      GetFinalPathNameByHandle on Windows.  However, GetFinalPathNameByHandle
      requires a HANDLE - the results of CreateFile - and you cannot
      CreateFile on a symbolic link.
      
      To support finding the canonical path of a symbolic link, simply use the
      existing POSIX code to look at the directory entries.
      Edward Thomson committed
    • win32: use GetFinalPathNameByHandle directly · 30771261
      Now that we've updated to WIN32_WINNT version of Vista or better, we
      don't need to dynamically load GetFinalPathNameByHandle and can simply
      invoke it directly.
      Edward Thomson committed
    • cmake: increase WIN32_WINNT to Vista · b8bdffb5
      Increase the WIN32_WINNT level to 0x0600, which enables support for new
      APIs from Windows 6.0 (Vista).  We had previously set this to 0x0501,
      which was Windows XP.  Although we removed XP support many years ago,
      there was no need to update this level previously.  We're doing so now
      explicitly so that we can get support for the `CreateSymbolicLink` API.
      Edward Thomson committed
  2. 19 Oct, 2018 3 commits
  3. 17 Oct, 2018 3 commits
  4. 15 Oct, 2018 5 commits
  5. 13 Oct, 2018 1 commit
  6. 12 Oct, 2018 1 commit
  7. 11 Oct, 2018 4 commits
    • Apply code review feedback · 463c21e2
      Nelson Elhage committed
    • fuzzers: add object parsing fuzzer · a1d5fd06
      Add a simple fuzzer that exercises our object parser code. The fuzzer
      is quite trivial in that it simply passes the input data directly to
      `git_object__from_raw` for each of the four object types.
      Patrick Steinhardt committed
    • object: properly propagate errors on parsing failures · 6562cdda
      When failing to parse a raw object fromits data, we free the
      partially parsed object but then fail to propagate the error to the
      caller. This may lead callers to operate on objects with invalid memory,
      which will sooner or later cause the program to segfault.
      
      Fix the issue by passing up the error code returned by `parse_raw`.
      Patrick Steinhardt committed
    • fuzzers: initialize libgit2 in standalone driver · 6956a954
      The standalone driver for libgit2's fuzzing targets makes use of
      functions from libgit2 itself. While this is totally fine to do, we need
      to make sure to always have libgit2 initialized via `git_libgit2_init`
      before we call out to any of these. While this happens in most cases as
      we call `LLVMFuzzerInitialize`, which is provided by our fuzzers and
      which right now always calls `git_libgit2_init`, one exception to this
      rule is our error path when not enough arguments have been given. In
      this case, we will call `git_vector_free_deep` without libgit2 having
      been initialized. As we did not set up our allocation functions in that
      case, this will lead to a segmentation fault.
      
      Fix the issue by always initializing and shutting down libgit2 in the
      standalone driver. Note that we cannot let this replace the
      initialization in `LLVMFuzzerInitialize`, as it is required when using
      the "real" fuzzers by LLVM without our standalone driver. It's no
      problem to call the initialization and deinitialization functions
      multiple times, though.
      Patrick Steinhardt committed
  8. 09 Oct, 2018 2 commits
  9. 07 Oct, 2018 3 commits
  10. 06 Oct, 2018 1 commit
    • ignore unsupported http authentication schemes · 475db39b
      auth_context_match returns 0 instead of -1 for unknown schemes to
      not fail in situations where some authentication schemes are supported
      and others are not.
      
      apply_credentials is adjusted to handle auth_context_match returning
      0 without producing authentication context.
      Anders Borum committed
  11. 05 Oct, 2018 5 commits