Skip to content
Snippets Groups Projects
Commit 5ade0344 authored by Junio C Hamano's avatar Junio C Hamano
Browse files

Merge branch 'en/incl-forward-decl'

Code hygiene improvement for the header files.

* en/incl-forward-decl:
  Remove forward declaration of an enum
  compat/precompose_utf8.h: use more common include guard style
  urlmatch.h: fix include guard
  Move definition of enum branch_track from cache.h to branch.h
  alloc: make allocate_alloc_state and clear_alloc_state more consistent
  Add missing includes and forward declarations
parents 36f0f344 1076f1e4
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -36,7 +36,7 @@ struct alloc_state {
int slab_nr, slab_alloc;
};
 
void *allocate_alloc_state(void)
struct alloc_state *allocate_alloc_state(void)
{
return xcalloc(1, sizeof(struct alloc_state));
}
Loading
Loading
#ifndef ALLOC_H
#define ALLOC_H
 
struct alloc_state;
struct tree;
struct commit;
struct tag;
struct repository;
 
void *alloc_blob_node(struct repository *r);
void *alloc_tree_node(struct repository *r);
Loading
Loading
@@ -13,7 +15,7 @@ void *alloc_object_node(struct repository *r);
void alloc_report(struct repository *r);
unsigned int alloc_commit_index(struct repository *r);
 
void *allocate_alloc_state(void);
struct alloc_state *allocate_alloc_state(void);
void clear_alloc_state(struct alloc_state *s);
 
#endif
#ifndef APPLY_H
#define APPLY_H
 
#include "lockfile.h"
#include "string-list.h"
struct repository;
 
enum apply_ws_error_action {
Loading
Loading
#ifndef ARCHIVE_H
#define ARCHIVE_H
 
#include "cache.h"
#include "pathspec.h"
 
struct repository;
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@ struct git_attr;
/* opaque structures used internally for attribute collection */
struct all_attrs_item;
struct attr_stack;
struct index_state;
 
/*
* Given a string, return the gitattribute object that
Loading
Loading
#ifndef BISECT_H
#define BISECT_H
 
struct commit_list;
/*
* Find bisection. If something is found, `reaches` will be the number of
* commits that the best commit reaches. `all` will be the count of
Loading
Loading
#ifndef BRANCH_H
#define BRANCH_H
 
struct strbuf;
enum branch_track {
BRANCH_TRACK_UNSPECIFIED = -1,
BRANCH_TRACK_NEVER = 0,
BRANCH_TRACK_REMOTE,
BRANCH_TRACK_ALWAYS,
BRANCH_TRACK_EXPLICIT,
BRANCH_TRACK_OVERRIDE
};
extern enum branch_track git_branch_track;
/* Functions for acting on the information about branches. */
 
/*
Loading
Loading
Loading
Loading
@@ -4,6 +4,8 @@
#ifndef BULK_CHECKIN_H
#define BULK_CHECKIN_H
 
#include "cache.h"
extern int index_bulk_checkin(struct object_id *oid,
int fd, size_t size, enum object_type type,
const char *path, unsigned flags);
Loading
Loading
Loading
Loading
@@ -917,15 +917,6 @@ enum log_refs_config {
};
extern enum log_refs_config log_all_ref_updates;
 
enum branch_track {
BRANCH_TRACK_UNSPECIFIED = -1,
BRANCH_TRACK_NEVER = 0,
BRANCH_TRACK_REMOTE,
BRANCH_TRACK_ALWAYS,
BRANCH_TRACK_EXPLICIT,
BRANCH_TRACK_OVERRIDE
};
enum rebase_setup_type {
AUTOREBASE_NEVER = 0,
AUTOREBASE_LOCAL,
Loading
Loading
@@ -942,7 +933,6 @@ enum push_default_type {
PUSH_DEFAULT_UNSPECIFIED
};
 
extern enum branch_track git_branch_track;
extern enum rebase_setup_type autorebase;
extern enum push_default_type push_default;
 
Loading
Loading
Loading
Loading
@@ -36,6 +36,7 @@ static inline int column_active(unsigned int colopts)
return (colopts & COL_ENABLE_MASK) == COL_ENABLED;
}
 
struct string_list;
extern void print_columns(const struct string_list *list, unsigned int colopts,
const struct column_options *opts);
 
Loading
Loading
Loading
Loading
@@ -4,6 +4,7 @@
#include "git-compat-util.h"
#include "repository.h"
#include "string-list.h"
#include "cache.h"
 
struct commit;
 
Loading
Loading
#ifndef PRECOMPOSE_UNICODE_H
#define PRECOMPOSE_UNICODE_H
#include <sys/stat.h>
#include <sys/types.h>
#include <dirent.h>
Loading
Loading
@@ -41,5 +43,4 @@ int precompose_utf8_closedir(PREC_DIR *dirp);
#define DIR PREC_DIR
#endif /* PRECOMPOSE_UNICODE_C */
 
#define PRECOMPOSE_UNICODE_H
#endif /* PRECOMPOSE_UNICODE_H */
Loading
Loading
@@ -6,6 +6,7 @@
*
*/
#include "cache.h"
#include "branch.h"
#include "config.h"
#include "repository.h"
#include "lockfile.h"
Loading
Loading
#ifndef CONFIG_H
#define CONFIG_H
 
#include "hashmap.h"
#include "string-list.h"
struct object_id;
/* git_config_parse_key() returns these negated: */
#define CONFIG_INVALID_KEY 1
#define CONFIG_NO_SECTION_OR_NAME 2
Loading
Loading
#ifndef CONNECTED_H
#define CONNECTED_H
 
struct object_id;
struct transport;
 
/*
Loading
Loading
Loading
Loading
@@ -7,6 +7,8 @@
#include "string-list.h"
 
struct index_state;
struct object_id;
struct strbuf;
 
#define CONV_EOL_RNDTRP_DIE (1<<0) /* Die if CRLF to LF to CRLF is different */
#define CONV_EOL_RNDTRP_WARN (1<<1) /* Warn if CRLF to LF to CRLF is different */
Loading
Loading
#ifndef CSUM_FILE_H
#define CSUM_FILE_H
 
#include "hash.h"
struct progress;
 
/* A SHA1-protected file */
Loading
Loading
Loading
Loading
@@ -4,6 +4,10 @@
#ifndef DIFFCORE_H
#define DIFFCORE_H
 
#include "cache.h"
struct diff_options;
/* This header file is internal between diff.c and its diff transformers
* (e.g. diffcore-rename, diffcore-pickaxe). Never include this header
* in anything else.
Loading
Loading
#ifndef DIR_ITERATOR_H
#define DIR_ITERATOR_H
 
#include "strbuf.h"
/*
* Iterate over a directory tree.
*
Loading
Loading
Loading
Loading
@@ -8,6 +8,7 @@
* are.
*/
#include "cache.h"
#include "branch.h"
#include "repository.h"
#include "config.h"
#include "refs.h"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment