Skip to content

Commit de7b5d6

Browse files
chriscoolgitster
authored andcommitted
sha1_object_info_extended(): add an "unsigned flags" parameter
This parameter is not used yet, but it will be used to tell sha1_object_info_extended() if it should perform object replacement or not. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent bf93eea commit de7b5d6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

builtin/cat-file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static int batch_one_object(const char *obj_name, struct batch_options *opt,
238238
return 0;
239239
}
240240

241-
if (sha1_object_info_extended(data->sha1, &data->info) < 0) {
241+
if (sha1_object_info_extended(data->sha1, &data->info, LOOKUP_REPLACE_OBJECT) < 0) {
242242
printf("%s missing\n", obj_name);
243243
fflush(stdout);
244244
return 0;

cache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,7 +1104,7 @@ struct object_info {
11041104
} packed;
11051105
} u;
11061106
};
1107-
extern int sha1_object_info_extended(const unsigned char *, struct object_info *);
1107+
extern int sha1_object_info_extended(const unsigned char *, struct object_info *, unsigned flags);
11081108

11091109
/* Dumb servers support */
11101110
extern int update_server_info(int);

sha1_file.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2514,7 +2514,7 @@ static int sha1_loose_object_info(const unsigned char *sha1,
25142514
return 0;
25152515
}
25162516

2517-
int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
2517+
int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi, unsigned flags)
25182518
{
25192519
struct cached_object *co;
25202520
struct pack_entry e;
@@ -2548,7 +2548,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
25482548
rtype = packed_object_info(e.p, e.offset, oi);
25492549
if (rtype < 0) {
25502550
mark_bad_packed_object(e.p, sha1);
2551-
return sha1_object_info_extended(sha1, oi);
2551+
return sha1_object_info_extended(sha1, oi, 0);
25522552
} else if (in_delta_base_cache(e.p, e.offset)) {
25532553
oi->whence = OI_DBCACHED;
25542554
} else {
@@ -2570,7 +2570,7 @@ int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
25702570

25712571
oi.typep = &type;
25722572
oi.sizep = sizep;
2573-
if (sha1_object_info_extended(sha1, &oi) < 0)
2573+
if (sha1_object_info_extended(sha1, &oi, LOOKUP_REPLACE_OBJECT) < 0)
25742574
return -1;
25752575
return type;
25762576
}

streaming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static enum input_source istream_source(const unsigned char *sha1,
113113

114114
oi->typep = type;
115115
oi->sizep = &size;
116-
status = sha1_object_info_extended(sha1, oi);
116+
status = sha1_object_info_extended(sha1, oi, 0);
117117
if (status < 0)
118118
return stream_error;
119119

0 commit comments

Comments
 (0)