]> git.proxmox.com Git - libgit2.git/commit - src/libgit2/repository.c
Support reading attributes from index
authorRussell Belfer <rb@github.com>
Thu, 3 May 2012 23:37:25 +0000 (16:37 -0700)
committerRussell Belfer <rb@github.com>
Thu, 3 May 2012 23:37:25 +0000 (16:37 -0700)
commitf917481ee84cbba481c1854cccdedb2d98377d43
treeb6276158b43f8d54358df5609fd0e508928306b2
parent3fbcac89c47cb66ea193f66da6d93d1c36ed0f5e
Support reading attributes from index

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.
39 files changed:
AUTHORS
include/git2/attr.h
src/attr.c
src/attr.h
src/attr_file.c
src/attr_file.h
src/crlf.c
src/diff_output.c
src/ignore.c
src/ignore.h
src/object.c
src/repository.c
src/repository.h
src/status.c
tests-clar/attr/file.c
tests-clar/attr/flags.c [new file with mode: 0644]
tests-clar/attr/lookup.c
tests-clar/attr/repo.c
tests-clar/diff/tree.c
tests-clar/resources/attr_index/.gitted/HEAD [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/config [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/description [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/index [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/info/exclude [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/info/refs [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/logs/HEAD [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/logs/refs/heads/master [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/objects/cd/f17ea3fe625ef812f4dce7f423f4f299287505 [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/objects/info/packs [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/objects/pack/pack-4e6438607204ce78827e3885594b2c0bb4f13895.idx [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/objects/pack/pack-4e6438607204ce78827e3885594b2c0bb4f13895.pack [new file with mode: 0644]
tests-clar/resources/attr_index/.gitted/packed-refs [new file with mode: 0644]
tests-clar/resources/attr_index/README.md [new file with mode: 0644]
tests-clar/resources/attr_index/README.txt [new file with mode: 0644]
tests-clar/resources/attr_index/gitattributes [new file with mode: 0644]
tests-clar/resources/attr_index/sub/sub/.gitattributes [new file with mode: 0644]
tests-clar/resources/attr_index/sub/sub/README.md [new file with mode: 0644]
tests-clar/resources/attr_index/sub/sub/README.txt [new file with mode: 0644]
tests-clar/status/ignore.c