Indent code with TABs

We indent with TABs and sometimes for fine alignment, TABs followed by
spaces, but never all spaces (unless the indentation is less than 8
columns). Indenting with spaces slips through in some places. Fix
them.

Imported code and compat/ are left alone on purpose. The former should
remain as close as upstream as possible. The latter pretty much has
separate maintainers, it's up to them to decide.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2018-12-06 16:42:06 +01:00 committed by Junio C Hamano
parent 965798d1f2
commit ec36c42a63
13 changed files with 73 additions and 73 deletions

View File

@ -142,7 +142,7 @@ static int stream_blocked(const struct object_id *oid)
* string and appends it to a struct strbuf. * string and appends it to a struct strbuf.
*/ */
static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword, static void strbuf_append_ext_header(struct strbuf *sb, const char *keyword,
const char *value, unsigned int valuelen) const char *value, unsigned int valuelen)
{ {
int len, tmp; int len, tmp;

View File

@ -36,8 +36,8 @@ void init_archivers(void)
} }
static void format_subst(const struct commit *commit, static void format_subst(const struct commit *commit,
const char *src, size_t len, const char *src, size_t len,
struct strbuf *buf) struct strbuf *buf)
{ {
char *to_free = NULL; char *to_free = NULL;
struct strbuf fmt = STRBUF_INIT; struct strbuf fmt = STRBUF_INIT;

View File

@ -176,7 +176,7 @@ static void refresh(int verbose, const struct pathspec *pathspec)
die(_("pathspec '%s' did not match any files"), die(_("pathspec '%s' did not match any files"),
pathspec->items[i].match); pathspec->items[i].match);
} }
free(seen); free(seen);
} }
int run_add_interactive(const char *revision, const char *patch_mode, int run_add_interactive(const char *revision, const char *patch_mode,

View File

@ -317,7 +317,7 @@ static void add_repack_all_option(struct string_list *keep_pack)
static void add_repack_incremental_option(void) static void add_repack_incremental_option(void)
{ {
argv_array_push(&repack, "--no-write-bitmap-index"); argv_array_push(&repack, "--no-write-bitmap-index");
} }
static int need_to_gc(void) static int need_to_gc(void)

View File

@ -448,7 +448,7 @@ int cache_tree_update(struct index_state *istate, int flags)
} }
static void write_one(struct strbuf *buffer, struct cache_tree *it, static void write_one(struct strbuf *buffer, struct cache_tree *it,
const char *path, int pathlen) const char *path, int pathlen)
{ {
int i; int i;

View File

@ -705,7 +705,7 @@ static int filter_buffer_or_fd(int in, int out, void *data)
} }
static int apply_single_file_filter(const char *path, const char *src, size_t len, int fd, static int apply_single_file_filter(const char *path, const char *src, size_t len, int fd,
struct strbuf *dst, const char *cmd) struct strbuf *dst, const char *cmd)
{ {
/* /*
* Create a pipeline to have the command filter the buffer's * Create a pipeline to have the command filter the buffer's
@ -1091,7 +1091,7 @@ static int count_ident(const char *cp, unsigned long size)
} }
static int ident_to_git(const char *path, const char *src, size_t len, static int ident_to_git(const char *path, const char *src, size_t len,
struct strbuf *buf, int ident) struct strbuf *buf, int ident)
{ {
char *dst, *dollar; char *dst, *dollar;
@ -1135,7 +1135,7 @@ static int ident_to_git(const char *path, const char *src, size_t len,
} }
static int ident_to_worktree(const char *path, const char *src, size_t len, static int ident_to_worktree(const char *path, const char *src, size_t len,
struct strbuf *buf, int ident) struct strbuf *buf, int ident)
{ {
struct object_id oid; struct object_id oid;
char *to_free = NULL, *dollar, *spc; char *to_free = NULL, *dollar, *spc;

View File

@ -721,7 +721,7 @@ extern const char *githstrerror(int herror);
#ifdef NO_MEMMEM #ifdef NO_MEMMEM
#define memmem gitmemmem #define memmem gitmemmem
void *gitmemmem(const void *haystack, size_t haystacklen, void *gitmemmem(const void *haystack, size_t haystacklen,
const void *needle, size_t needlelen); const void *needle, size_t needlelen);
#endif #endif
#ifdef OVERRIDE_STRDUP #ifdef OVERRIDE_STRDUP

View File

@ -236,7 +236,7 @@ static int parse_short_opt(struct parse_opt_ctx_t *p, const struct option *optio
} }
static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg, static int parse_long_opt(struct parse_opt_ctx_t *p, const char *arg,
const struct option *options) const struct option *options)
{ {
const struct option *all_opts = options; const struct option *all_opts = options;
const char *arg_end = strchrnul(arg, '='); const char *arg_end = strchrnul(arg, '=');

View File

@ -175,11 +175,11 @@ struct option {
* Returns the number of arguments left in argv[]. * Returns the number of arguments left in argv[].
*/ */
extern int parse_options(int argc, const char **argv, const char *prefix, extern int parse_options(int argc, const char **argv, const char *prefix,
const struct option *options, const struct option *options,
const char * const usagestr[], int flags); const char * const usagestr[], int flags);
extern NORETURN void usage_with_options(const char * const *usagestr, extern NORETURN void usage_with_options(const char * const *usagestr,
const struct option *options); const struct option *options);
extern NORETURN void usage_msg_opt(const char *msg, extern NORETURN void usage_msg_opt(const char *msg,
const char * const *usagestr, const char * const *usagestr,

View File

@ -234,7 +234,7 @@ static size_t next_quote_pos(const char *s, ssize_t maxlen)
* Return value is the same as in (1). * Return value is the same as in (1).
*/ */
static size_t quote_c_style_counted(const char *name, ssize_t maxlen, static size_t quote_c_style_counted(const char *name, ssize_t maxlen,
struct strbuf *sb, FILE *fp, int no_dq) struct strbuf *sb, FILE *fp, int no_dq)
{ {
#undef EMIT #undef EMIT
#define EMIT(c) \ #define EMIT(c) \

View File

@ -3494,71 +3494,71 @@ static void write_eoie_extension(struct strbuf *sb, git_hash_ctx *eoie_context,
static struct index_entry_offset_table *read_ieot_extension(const char *mmap, size_t mmap_size, size_t offset) static struct index_entry_offset_table *read_ieot_extension(const char *mmap, size_t mmap_size, size_t offset)
{ {
const char *index = NULL; const char *index = NULL;
uint32_t extsize, ext_version; uint32_t extsize, ext_version;
struct index_entry_offset_table *ieot; struct index_entry_offset_table *ieot;
int i, nr; int i, nr;
/* find the IEOT extension */ /* find the IEOT extension */
if (!offset) if (!offset)
return NULL; return NULL;
while (offset <= mmap_size - the_hash_algo->rawsz - 8) { while (offset <= mmap_size - the_hash_algo->rawsz - 8) {
extsize = get_be32(mmap + offset + 4); extsize = get_be32(mmap + offset + 4);
if (CACHE_EXT((mmap + offset)) == CACHE_EXT_INDEXENTRYOFFSETTABLE) { if (CACHE_EXT((mmap + offset)) == CACHE_EXT_INDEXENTRYOFFSETTABLE) {
index = mmap + offset + 4 + 4; index = mmap + offset + 4 + 4;
break; break;
} }
offset += 8; offset += 8;
offset += extsize; offset += extsize;
} }
if (!index) if (!index)
return NULL; return NULL;
/* validate the version is IEOT_VERSION */ /* validate the version is IEOT_VERSION */
ext_version = get_be32(index); ext_version = get_be32(index);
if (ext_version != IEOT_VERSION) { if (ext_version != IEOT_VERSION) {
error("invalid IEOT version %d", ext_version); error("invalid IEOT version %d", ext_version);
return NULL; return NULL;
} }
index += sizeof(uint32_t); index += sizeof(uint32_t);
/* extension size - version bytes / bytes per entry */ /* extension size - version bytes / bytes per entry */
nr = (extsize - sizeof(uint32_t)) / (sizeof(uint32_t) + sizeof(uint32_t)); nr = (extsize - sizeof(uint32_t)) / (sizeof(uint32_t) + sizeof(uint32_t));
if (!nr) { if (!nr) {
error("invalid number of IEOT entries %d", nr); error("invalid number of IEOT entries %d", nr);
return NULL; return NULL;
} }
ieot = xmalloc(sizeof(struct index_entry_offset_table) ieot = xmalloc(sizeof(struct index_entry_offset_table)
+ (nr * sizeof(struct index_entry_offset))); + (nr * sizeof(struct index_entry_offset)));
ieot->nr = nr; ieot->nr = nr;
for (i = 0; i < nr; i++) { for (i = 0; i < nr; i++) {
ieot->entries[i].offset = get_be32(index); ieot->entries[i].offset = get_be32(index);
index += sizeof(uint32_t); index += sizeof(uint32_t);
ieot->entries[i].nr = get_be32(index); ieot->entries[i].nr = get_be32(index);
index += sizeof(uint32_t); index += sizeof(uint32_t);
} }
return ieot; return ieot;
} }
static void write_ieot_extension(struct strbuf *sb, struct index_entry_offset_table *ieot) static void write_ieot_extension(struct strbuf *sb, struct index_entry_offset_table *ieot)
{ {
uint32_t buffer; uint32_t buffer;
int i; int i;
/* version */ /* version */
put_be32(&buffer, IEOT_VERSION); put_be32(&buffer, IEOT_VERSION);
strbuf_add(sb, &buffer, sizeof(uint32_t)); strbuf_add(sb, &buffer, sizeof(uint32_t));
/* ieot */ /* ieot */
for (i = 0; i < ieot->nr; i++) { for (i = 0; i < ieot->nr; i++) {
/* offset */ /* offset */
put_be32(&buffer, ieot->entries[i].offset); put_be32(&buffer, ieot->entries[i].offset);
strbuf_add(sb, &buffer, sizeof(uint32_t)); strbuf_add(sb, &buffer, sizeof(uint32_t));
/* count */ /* count */
put_be32(&buffer, ieot->entries[i].nr); put_be32(&buffer, ieot->entries[i].nr);
strbuf_add(sb, &buffer, sizeof(uint32_t)); strbuf_add(sb, &buffer, sizeof(uint32_t));
} }
} }

View File

@ -1495,8 +1495,8 @@ void repo_init_revisions(struct repository *r,
} }
static void add_pending_commit_list(struct rev_info *revs, static void add_pending_commit_list(struct rev_info *revs,
struct commit_list *commit_list, struct commit_list *commit_list,
unsigned int flags) unsigned int flags)
{ {
while (commit_list) { while (commit_list) {
struct object *object = &commit_list->item->object; struct object *object = &commit_list->item->object;

View File

@ -221,7 +221,7 @@ int has_symlink_leading_path(const char *name, int len)
*/ */
int check_leading_path(const char *name, int len) int check_leading_path(const char *name, int len)
{ {
return threaded_check_leading_path(&default_cache, name, len); return threaded_check_leading_path(&default_cache, name, len);
} }
/* /*