diff options
| author | Brian Lopez <seniorlopez@gmail.com> | 2018-01-10 19:19:34 -0800 |
|---|---|---|
| committer | Brian Lopez <seniorlopez@gmail.com> | 2018-01-10 19:19:34 -0800 |
| commit | 5734768b9edaecedaa7b13fed2ce59cb588df7e8 (patch) | |
| tree | 84a845211a548cef770bbccd32d6d041a2bcea2b /src/diff_driver.c | |
| parent | f4f0e7eb0f8280ed6100c37c3af0aa66c31a8f9e (diff) | |
| parent | f1323d9c161aeeada190fd9615a8b5a9fb8a7f3e (diff) | |
| download | libgit2-5734768b9edaecedaa7b13fed2ce59cb588df7e8.tar.gz | |
Merge remote-tracking branch 'origin/master' into charliesome/trailer-info
Diffstat (limited to 'src/diff_driver.c')
| -rw-r--r-- | src/diff_driver.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/diff_driver.c b/src/diff_driver.c index 8cd57cdf6..7114b06b6 100644 --- a/src/diff_driver.c +++ b/src/diff_driver.c @@ -354,27 +354,30 @@ done: } int git_diff_driver_lookup( - git_diff_driver **out, git_repository *repo, const char *path) + git_diff_driver **out, git_repository *repo, + git_attr_session *attrsession, const char *path) { int error = 0; - const char *value; + const char *values[1], *attrs[] = { "diff" }; assert(out); *out = NULL; if (!repo || !path || !strlen(path)) /* just use the auto value */; - else if ((error = git_attr_get(&value, repo, 0, path, "diff")) < 0) + else if ((error = git_attr_get_many_with_session(values, repo, + attrsession, 0, path, 1, attrs)) < 0) /* return error below */; - else if (GIT_ATTR_UNSPECIFIED(value)) + + else if (GIT_ATTR_UNSPECIFIED(values[0])) /* just use the auto value */; - else if (GIT_ATTR_FALSE(value)) + else if (GIT_ATTR_FALSE(values[0])) *out = &global_drivers[DIFF_DRIVER_BINARY]; - else if (GIT_ATTR_TRUE(value)) + else if (GIT_ATTR_TRUE(values[0])) *out = &global_drivers[DIFF_DRIVER_TEXT]; /* otherwise look for driver information in config and build driver */ - else if ((error = git_diff_driver_load(out, repo, value)) < 0) { + else if ((error = git_diff_driver_load(out, repo, values[0])) < 0) { if (error == GIT_ENOTFOUND) { error = 0; giterr_clear(); |
