1. 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
  2. 04 Feb, 2017 2 commits
  3. 02 Feb, 2017 4 commits
  4. 27 Jan, 2017 3 commits
    • Merge pull request #4095 from mplough/master · dad3c319
      Fix uninitialized variable warning
      Edward Thomson committed
    • Fix uninitialized variable warning · d0c418c0
      Fix the following warning emitted by clang:
      [ 16%] Building C object CMakeFiles/libgit2_clar.dir/src/submodule.c.o
      /Users/mplough/devel/external/libgit2/src/submodule.c:408:6: warning: variable 'i' is used uninitialized whenever 'if' condition is true
            [-Wsometimes-uninitialized]
              if ((error = load_submodule_names(names, cfg)))
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/mplough/devel/external/libgit2/src/submodule.c:448:20: note: uninitialized use occurs here
              git_iterator_free(i);
                                ^
      /Users/mplough/devel/external/libgit2/src/submodule.c:408:2: note: remove the 'if' if its condition is always false
              if ((error = load_submodule_names(names, cfg)))
              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      /Users/mplough/devel/external/libgit2/src/submodule.c:404:17: note: initialize the variable 'i' to silence this warning
              git_iterator *i;
                             ^
                              = NULL
      1 warning generated.
      Matthew Plough committed
  5. 24 Jan, 2017 2 commits
  6. 23 Jan, 2017 8 commits
  7. 21 Jan, 2017 15 commits
  8. 20 Jan, 2017 3 commits
    • Skip submodule head/index update when caching. · 673dff88
      `git_submodule_status` is very slow, bottlenecked on
      `git_repository_head_tree`, which it uses through `submodule_update_head`.  If
      the user has requested submodule caching, assume that they want this status
      cached too and skip it.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      Brock Peabody committed
    • Allow for caching of submodules. · 4d99c4cf
      Added `git_repository_submodule_cache_all` to initialze a cache of
      submodules on the repository so that operations looking up N
      submodules are O(N) and not O(N^2).  Added a
      `git_repository_submodule_cache_clear` function to remove the cache.
      
      Also optimized the function that loads all submodules as it was itself
      O(N^2) w.r.t the number of submodules, having to loop through the
      `.gitmodules` file once per submodule.  I changed it to process the
      `.gitmodules` file once, into a map.
      
      Signed-off-by: David Turner <dturner@twosigma.com>
      Brock Peabody committed
    • Fix formatting · ca05857e
      Signed-off-by: David Turner <dturner@twosigma.com>
      David Turner committed