1. 18 Mar, 2013 2 commits
    • Fixes and cleanups · 32460251
      Get rid of some dead code, tighten things up a bit, and fix a bug
      with core::env test.
      Russell Belfer committed
    • Switch search paths to classic delimited strings · 41954a49
      This switches the APIs for setting and getting the global/system
      search paths from using git_strarray to using a simple string with
      GIT_PATH_LIST_SEPARATOR delimited paths, just as the environment
      PATH variable would contain.  This makes it simpler to get and set
      the value.
      
      I also added code to expand "$PATH" when setting a new value to
      embed the old value of the path.  This means that I no longer
      require separate actions to PREPEND to the value.
      Russell Belfer committed
  2. 15 Mar, 2013 1 commit
    • Implement global/system file search paths · 5540d947
      The goal of this work is to expose the search logic for "global",
      "system", and "xdg" files through the git_libgit2_opts() interface.
      
      Behind the scenes, I changed the logic for finding files to have a
      notion of a git_strarray that represents a search path and to store
      a separate search path for each of the three tiers of config file.
      For each tier, I implemented a function to initialize it to default
      values (generally based on environment variables), and then general
      interfaces to get it, set it, reset it, and prepend new directories
      to it.
      
      Next, I exposed these interfaces through the git_libgit2_opts
      interface, reusing the GIT_CONFIG_LEVEL_SYSTEM, etc., constants
      for the user to control which search path they were modifying.
      There are alternative designs for the opts interface / argument
      ordering, so I'm putting this phase out for discussion.
      
      Additionally, I ended up doing a little bit of clean up regarding
      attr.h and attr_file.h, adding a new attrcache.h so the other two
      files wouldn't have to be included in so many places.
      Russell Belfer committed
  3. 16 Feb, 2013 1 commit
    • Clear up warnings from cppcheck · 56543a60
      The cppcheck static analyzer generates warnings for a bunch of
      places in the libgit2 code base.  All the ones fixed in this
      commit are actually false positives, but I've reorganized the
      code to hopefully make it easier for static analysis tools to
      correctly understand the structure.  I wouldn't do this if I
      felt like it was making the code harder to read or worse for
      humans, but in this case, these fixes don't seem too bad and will
      hopefully make it easier for better analysis tools to get at any
      real issues.
      Russell Belfer committed
  4. 17 Jan, 2013 1 commit
  5. 03 Jan, 2013 3 commits
  6. 23 Nov, 2012 1 commit
    • Reset all static variables to NULL in clar's __cleanup · 9094d30b
      Without this change, any failed assertion in the second (or a later) test
      inside a test suite has a chance of double deleting memory, resulting in
      a heap corruption. See #1096 for details.
      
      This leaves alone the test cases where we "just" use cl_git_sandbox_init()
      and cl_git_sandbox_cleanup(). These methods already take good care to not
      double delete a repository.
      
      Fixes #1096
      Sascha Cunz committed
  7. 17 Nov, 2012 1 commit
  8. 19 Oct, 2012 1 commit
    • Fix env variable tests with new Win32 path rules · 0d422ec9
      The new Win32 global path search was not working with the
      environment variable tests.  But when I fixed the test, the new
      codes use of getenv() was causing more failures (presumably because
      of caching on Windows ???).  This fixes the global file lookup to
      always go directly to the Win32 API in a predictable way.
      Russell Belfer committed
  9. 16 Oct, 2012 1 commit
  10. 19 Jun, 2012 1 commit
  11. 08 Jun, 2012 1 commit
  12. 26 May, 2012 1 commit
  13. 25 May, 2012 2 commits
    • Make errors for system and global files consistent · 29ef309e
      The error codes from failed lookups of system and global files
      on Windows were not consistent with the codes returned on other
      platforms.  This makes the error detection patterns match and
      adds a unit test for the various errors.
      Russell Belfer committed
    • Fix bugs for status with spaces and reloaded attrs · 2a99df69
      This fixes two bugs:
      
      * Issue #728 where git_status_file was not working for files
        that contain spaces.  This was caused by reusing the "fnmatch"
        parsing code from ignore and attribute files to interpret the
        "pathspec" that constrained the files to apply the status to.
        In that code, unescaped whitespace was considered terminal to
        the pattern, so a file with internal whitespace was excluded
        from the matched files.  The fix was to add a mode to that code
        that allows spaces and tabs inside patterns.  This mode only
        comes into play when parsing in-memory strings.
      
      * The other issue was undetected, but it was in the recently
        added code to reload gitattributes / gitignores when they were
        changed on disk.  That code was not clearing out the old values
        from the cached file content before reparsing which meant that
        newly added patterns would be read in, but deleted patterns
        would not be removed.  The fix was to clear the vector of
        patterns in a cached file before reparsing the file.
      Russell Belfer committed
  14. 24 May, 2012 3 commits