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 <junkio@cox.net>
Junio C Hamano committed
Apr 1, 2007 at 21:13 UTC
0424138d5715dbf8605bacfbd22210aac85a1a8f
3 files changed
+2
-3
cache.h
-1
@@ -128,7 +128,6 @@ static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned in
128
extern struct cache_entry **active_cache;
129
extern unsigned int active_nr, active_alloc, active_cache_changed;
130
extern struct cache_tree *active_cache_tree;
131
-extern int cache_errno;
131
132
enum object_type {
133
OBJ_BAD = -1,
merge-recursive.c
+1
-1
@@ -221,7 +221,7 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
221
struct cache_entry *ce;
222
ce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage, refresh);
223
if (!ce)
224
- return error("cache_addinfo failed: %s", strerror(cache_errno));
224
+ return error("addinfo_cache failed for path '%s'", path);
225
return add_cache_entry(ce, options);
226
}
227
read-cache.c
+1
-1
@@ -24,7 +24,7 @@ unsigned int active_nr, active_alloc, active_cache_changed;
24
25
struct cache_tree *active_cache_tree;
26
27
-int cache_errno;
27
+static int cache_errno;
28
29
static void *cache_mmap;
30
static size_t cache_mmap_size;