1. 25 May, 2012 1 commit
    • 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
  2. 03 May, 2012 1 commit
    • Support reading attributes from index · f917481e
      Depending on the operation, we need to consider gitattributes
      in both the work dir and the index.  This adds a parameter to
      all of the gitattributes related functions that allows user
      control of attribute reading behavior (i.e. prefer workdir,
      prefer index, only use index).
      
      This fix also covers allowing us to check attributes (and
      hence do diff and status) on bare repositories.
      
      This was a somewhat larger change that I hoped because it had
      to change the cache key used for gitattributes files.
      Russell Belfer committed
  3. 25 Apr, 2012 1 commit
  4. 17 Apr, 2012 1 commit
  5. 13 Apr, 2012 1 commit
  6. 02 Mar, 2012 1 commit
    • attr: Change the attribute check macros · c63793ee
      The point of having `GIT_ATTR_TRUE` and `GIT_ATTR_FALSE` macros is to be
      able to change the way that true and false values are stored inside of
      the returned gitattributes value pointer.
      
      However, if these macros are implemented as a simple rename for the
      `git_attr__true` pointer, they will always be used with the `==`
      operator, and hence we cannot really change the implementation to any
      other way that doesn't imply using special pointer values and comparing
      them!
      
      We need to do the same thing that core Git does, which is using a
      function macro. With `GIT_ATTR_TRUE(attr)`, we can change
      internally the way that these values are stored to anything we want.
      
      This commit does that, and rewrites a large chunk of the attributes test
      suite to remove duplicated code for expected attributes, and to
      properly test the function macro behavior instead of comparing
      pointers.
      Vicent Martí committed
  7. 25 Jan, 2012 1 commit
  8. 17 Jan, 2012 1 commit
    • Fix handling of relative paths for attrs · a51cd8e6
      Per issue #533, the handling of relative paths in attribute
      and ignore files was not right.  Fixed this by pre-joining
      the relative path of the attribute/ignore file onto the match
      string when a full path match is required.
      
      Unfortunately, fixing this required a bit more code than I
      would have liked because I had to juggle things around so that
      the fnmatch parser would have sufficient information to prepend
      the relative path when it was needed.
      Russell Belfer committed
  9. 04 Jan, 2012 1 commit
  10. 29 Dec, 2011 1 commit
    • Add support for macros and cache flush API. · 73b51450
      Add support for git attribute macro definitions.  Also, add
      support for cache flush API to clear the attribute file content
      cache when needed.
      
      Additionally, improved the handling of global and system files,
      making common utility functions in fileops and converting config
      and attr to both use the common functions.
      
      Adds a bunch more tests and fixed some memory leaks.  Note that
      adding macros required me to use refcounted attribute assignment
      definitions, which complicated, but probably improved memory usage.
      Russell Belfer committed
  11. 21 Dec, 2011 1 commit
    • Add APIs for git attributes · ee1f0b1a
      This adds APIs for querying git attributes.  In addition to
      the new API in include/git2/attr.h, most of the action is in
      src/attr_file.[hc] which contains utilities for dealing with
      a single attributes file, and src/attr.[hc] which contains
      the implementation of the APIs that merge all applicable
      attributes files.
      Russell Belfer committed