summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-10-27 14:58:48 -0700
committerJunio C Hamano <gitster@pobox.com>2016-10-27 14:58:48 -0700
commit0d9c527d5963fca098ea4964f4129511bd5d82d8 (patch)
treefdc63c9e33954d77aa5299e0fb02e1cba49a01cc /t
parentf9db0c055c2f93021ee32a069e15b9e54f39f0da (diff)
parent4f03666ac69ec4799998f010d04916c12e38edf8 (diff)
downloadgit-0d9c527d5963fca098ea4964f4129511bd5d82d8.tar.gz
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 't')
-rw-r--r--t/helper/test-dump-cache-tree.c1
-rw-r--r--t/helper/test-scrap-cache-tree.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/t/helper/test-dump-cache-tree.c b/t/helper/test-dump-cache-tree.c
index 44f3290258..7af116d49e 100644
--- a/t/helper/test-dump-cache-tree.c
+++ b/t/helper/test-dump-cache-tree.c
@@ -58,6 +58,7 @@ int cmd_main(int ac, const char **av)
{
struct index_state istate;
struct cache_tree *another = cache_tree();
+ setup_git_directory();
if (read_cache() < 0)
die("unable to read index file");
istate = the_index;
diff --git a/t/helper/test-scrap-cache-tree.c b/t/helper/test-scrap-cache-tree.c
index 5b2fd09908..27fe0405b8 100644
--- a/t/helper/test-scrap-cache-tree.c
+++ b/t/helper/test-scrap-cache-tree.c
@@ -7,6 +7,7 @@ static struct lock_file index_lock;
int cmd_main(int ac, const char **av)
{
+ setup_git_directory();
hold_locked_index(&index_lock, 1);
if (read_cache() < 0)
die("unable to read index file");