Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-05-04 03:37:25 +0400
committerRussell Belfer <rb@github.com>2012-05-04 03:37:25 +0400
commitf917481ee84cbba481c1854cccdedb2d98377d43 (patch)
treeb6276158b43f8d54358df5609fd0e508928306b2 /src/crlf.c
parent3fbcac89c47cb66ea193f66da6d93d1c36ed0f5e (diff)
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.
Diffstat (limited to 'src/crlf.c')
-rw-r--r--src/crlf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/crlf.c b/src/crlf.c
index b495d2de0..5d09a1f40 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -82,7 +82,8 @@ static int crlf_load_attributes(struct crlf_attrs *ca, git_repository *repo, con
const char *attr_vals[NUM_CONV_ATTRS];
int error;
- error = git_attr_get_many(repo, path, NUM_CONV_ATTRS, attr_names, attr_vals);
+ error = git_attr_get_many(
+ repo, 0, path, NUM_CONV_ATTRS, attr_names, attr_vals);
if (error == GIT_ENOTFOUND) {
ca->crlf_action = GIT_CRLF_GUESS;