Browse Source

treewide: reduce includes of cache.h in other headers

We had a handful of headers including cache.h that didn't need to
anymore.  Drop those includes and replace them with includes of
smaller files, or forward declarations.  However, note that two .c
files now need to directly include cache.h, though they should have
been including it all along given they are directly using structs
defined in it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Acked-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
main
Elijah Newren 2 years ago committed by Junio C Hamano
parent
commit
b7b189cd5a
  1. 2
      archive.h
  2. 3
      chdir-notify.c
  3. 3
      quote.c
  4. 2
      refs/ref-cache.h
  5. 2
      rerere.c
  6. 7
      resolve-undo.h
  7. 2
      revision.c
  8. 2
      split-index.h

2
archive.h

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
#ifndef ARCHIVE_H
#define ARCHIVE_H

#include "cache.h"
#include "object-name.h"
#include "pathspec.h"
#include "string-list.h"

struct repository;
struct pretty_print_context;

3
chdir-notify.c

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
#include "cache.h"
#include "git-compat-util.h"
#include "abspath.h"
#include "chdir-notify.h"
#include "list.h"
#include "path.h"
#include "strbuf.h"
#include "trace.h"


3
quote.c

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "cache.h"
#include "git-compat-util.h"
#include "alloc.h"
#include "path.h"
#include "quote.h"
#include "strbuf.h"
#include "strvec.h"

2
refs/ref-cache.h

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#ifndef REFS_REF_CACHE_H
#define REFS_REF_CACHE_H

#include "cache.h"
#include "hash.h"

struct ref_dir;
struct ref_store;

2
rerere.c

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "git-compat-util.h"
#include "cache.h"
#include "abspath.h"
#include "alloc.h"
#include "config.h"

7
resolve-undo.h

@ -1,7 +1,12 @@ @@ -1,7 +1,12 @@
#ifndef RESOLVE_UNDO_H
#define RESOLVE_UNDO_H

#include "cache.h"
struct cache_entry;
struct index_state;
struct pathspec;
struct string_list;

#include "hash.h"

struct resolve_undo_info {
unsigned int mode[3];

2
revision.c

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "git-compat-util.h"
#include "cache.h"
#include "alloc.h"
#include "config.h"
#include "environment.h"

2
split-index.h

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
#ifndef SPLIT_INDEX_H
#define SPLIT_INDEX_H

#include "cache.h"
#include "hash.h"

struct index_state;
struct strbuf;

Loading…
Cancel
Save