mirror of
https://github.com/git/git.git
synced 2026-01-18 14:44:28 +00:00
cache-tree.c: avoid reusing the DEBUG constant
In MSVC, the DEBUG constant is set automatically whenever compiling with debug information. This is clearly not what was intended in cache-tree.c, so let's use a less ambiguous constant there. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
This commit is contained in:
committed by
Johannes Schindelin
parent
1cac9322cf
commit
4d9789d14c
14
cache-tree.c
14
cache-tree.c
@@ -5,8 +5,8 @@
|
||||
#include "cache-tree.h"
|
||||
#include "object-store.h"
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 0
|
||||
#ifndef DEBUG_CACHE_TREE
|
||||
#define DEBUG_CACHE_TREE 0
|
||||
#endif
|
||||
|
||||
struct cache_tree *cache_tree(void)
|
||||
@@ -110,7 +110,7 @@ static int do_invalidate_path(struct cache_tree *it, const char *path)
|
||||
int namelen;
|
||||
struct cache_tree_sub *down;
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG_CACHE_TREE
|
||||
fprintf(stderr, "cache-tree invalidate <%s>\n", path);
|
||||
#endif
|
||||
|
||||
@@ -393,7 +393,7 @@ static int update_one(struct cache_tree *it,
|
||||
strbuf_addf(&buffer, "%o %.*s%c", mode, entlen, path + baselen, '\0');
|
||||
strbuf_add(&buffer, oid->hash, the_hash_algo->rawsz);
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG_CACHE_TREE
|
||||
fprintf(stderr, "cache-tree update-one %o %.*s\n",
|
||||
mode, entlen, path + baselen);
|
||||
#endif
|
||||
@@ -416,7 +416,7 @@ static int update_one(struct cache_tree *it,
|
||||
|
||||
strbuf_release(&buffer);
|
||||
it->entry_count = to_invalidate ? -1 : i - *skip_count;
|
||||
#if DEBUG
|
||||
#if DEBUG_CACHE_TREE
|
||||
fprintf(stderr, "cache-tree update-one (%d ent, %d subtree) %s\n",
|
||||
it->entry_count, it->subtree_nr,
|
||||
oid_to_hex(&it->oid));
|
||||
@@ -455,7 +455,7 @@ static void write_one(struct strbuf *buffer, struct cache_tree *it,
|
||||
strbuf_add(buffer, path, pathlen);
|
||||
strbuf_addf(buffer, "%c%d %d\n", 0, it->entry_count, it->subtree_nr);
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG_CACHE_TREE
|
||||
if (0 <= it->entry_count)
|
||||
fprintf(stderr, "cache-tree <%.*s> (%d ent, %d subtree) %s\n",
|
||||
pathlen, path, it->entry_count, it->subtree_nr,
|
||||
@@ -529,7 +529,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p)
|
||||
size -= rawsz;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
#if DEBUG_CACHE_TREE
|
||||
if (0 <= it->entry_count)
|
||||
fprintf(stderr, "cache-tree <%s> (%d ent, %d subtree) %s\n",
|
||||
*buffer, it->entry_count, subtree_nr,
|
||||
|
||||
Reference in New Issue
Block a user