diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:17 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-12-21 15:03:17 -0800 |
| commit | 8d2c37320bd01bbce4b88365c160bc4a542bee48 (patch) | |
| tree | d805155422fb863b694eaaeb71967d9667f9e81d /commit-graph.c | |
| parent | Merge branch 'en/name-rev-shorter-output' (diff) | |
| parent | blame: enable and test the sparse index (diff) | |
| download | git-8d2c37320bd01bbce4b88365c160bc4a542bee48.tar.gz git-8d2c37320bd01bbce4b88365c160bc4a542bee48.zip | |
Merge branch 'ld/sparse-diff-blame'
Teach diff and blame to work well with sparse index.
* ld/sparse-diff-blame:
blame: enable and test the sparse index
diff: enable and test the sparse index
diff: replace --staged with --cached in t1092 tests
repo-settings: prepare_repo_settings only in git repos
test-read-cache: set up repo after git directory
commit-graph: return if there is no git directory
git: ensure correct git directory setup with -h
Diffstat (limited to 'commit-graph.c')
| -rw-r--r-- | commit-graph.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/commit-graph.c b/commit-graph.c index 2706683acf..265c010122 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -632,10 +632,13 @@ static int prepare_commit_graph(struct repository *r) struct object_directory *odb; /* + * Early return if there is no git dir or if the commit graph is + * disabled. + * * This must come before the "already attempted?" check below, because * we want to disable even an already-loaded graph file. */ - if (r->commit_graph_disabled) + if (!r->gitdir || r->commit_graph_disabled) return 0; if (r->objects->commit_graph_attempted) |
