Skip to content

Commit 0424138

Browse files
author
Junio C Hamano
committed
Fix bogus error message from merge-recursive error path
This error message should not usually trigger, but the function make_cache_entry() called by add_cacheinfo() can return early without calling into refresh_cache_entry() that sets cache_errno. Also the error message had a wrong function name reported, and it did not say anything about which path failed either. Signed-off-by: Junio C Hamano <[email protected]>
1 parent b188258 commit 0424138

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned in
128128
extern struct cache_entry **active_cache;
129129
extern unsigned int active_nr, active_alloc, active_cache_changed;
130130
extern struct cache_tree *active_cache_tree;
131-
extern int cache_errno;
132131

133132
enum object_type {
134133
OBJ_BAD = -1,

merge-recursive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
221221
struct cache_entry *ce;
222222
ce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage, refresh);
223223
if (!ce)
224-
return error("cache_addinfo failed: %s", strerror(cache_errno));
224+
return error("addinfo_cache failed for path '%s'", path);
225225
return add_cache_entry(ce, options);
226226
}
227227

read-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ unsigned int active_nr, active_alloc, active_cache_changed;
2424

2525
struct cache_tree *active_cache_tree;
2626

27-
int cache_errno;
27+
static int cache_errno;
2828

2929
static void *cache_mmap;
3030
static size_t cache_mmap_size;

0 commit comments

Comments
 (0)