diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-27 14:58:48 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-27 14:58:48 -0700 |
commit | 0d9c527d5963fca098ea4964f4129511bd5d82d8 (patch) | |
tree | fdc63c9e33954d77aa5299e0fb02e1cba49a01cc /attr.c | |
parent | f9db0c055c2f93021ee32a069e15b9e54f39f0da (diff) | |
parent | 4f03666ac69ec4799998f010d04916c12e38edf8 (diff) | |
download | git-0d9c527d5963fca098ea4964f4129511bd5d82d8.tar.gz git-0d9c527d5963fca098ea4964f4129511bd5d82d8.tar.xz |
Merge branch 'jk/no-looking-at-dotgit-outside-repo'
Update "git diff --no-index" codepath not to try to peek into .git/
directory that happens to be under the current directory, when we
know we are operating outside any repository.
* jk/no-looking-at-dotgit-outside-repo:
diff: handle sha1 abbreviations outside of repository
diff_aligned_abbrev: use "struct oid"
diff_unique_abbrev: rename to diff_aligned_abbrev
find_unique_abbrev: use 4-buffer ring
test-*-cache-tree: setup git dir
read info/{attributes,exclude} only when in repository
Diffstat (limited to 'attr.c')
-rw-r--r-- | attr.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -531,7 +531,11 @@ static void bootstrap_attr_stack(void) debug_push(elem); } - elem = read_attr_from_file(git_path_info_attributes(), 1); + if (startup_info->have_repository) + elem = read_attr_from_file(git_path_info_attributes(), 1); + else + elem = NULL; + if (!elem) elem = xcalloc(1, sizeof(*elem)); elem->origin = NULL; |