]> git.proxmox.com Git - libgit2.git/commit
Fix bugs for status with spaces and reloaded attrs
authorRussell Belfer <rb@github.com>
Fri, 25 May 2012 00:14:56 +0000 (17:14 -0700)
committerRussell Belfer <rb@github.com>
Fri, 25 May 2012 00:14:56 +0000 (17:14 -0700)
commit2a99df6909af4c93ce2741ddc5d15a7f52270f28
tree3b1fc3f206d156b356b4a342ea94eadad99192f1
parenta4452eb1b929b95f69768d398008f6f8844941e4
Fix bugs for status with spaces and reloaded attrs

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.
src/attr.c
src/attr_file.c
src/attr_file.h
src/diff.c
tests-clar/attr/attr_expect.h
tests-clar/attr/file.c
tests-clar/attr/lookup.c
tests-clar/attr/repo.c
tests-clar/core/env.c
tests-clar/status/worktree.c