Skip to content

Commit 670e591

Browse files
committed
implemented changes required to fix fetching/clonning repository and
compile
1 parent 46915ec commit 670e591

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+259
-246
lines changed

apply.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3157,7 +3157,7 @@ static int apply_binary_fragment(struct apply_state *state,
31573157
struct patch *patch)
31583158
{
31593159
struct fragment *fragment = patch->fragments;
3160-
unsigned long len;
3160+
size_t len;
31613161
void *dst;
31623162

31633163
if (!fragment)
@@ -3246,7 +3246,7 @@ static int apply_binary(struct apply_state *state,
32463246
if (odb_has_object(the_repository->objects, &oid, 0)) {
32473247
/* We already have the postimage */
32483248
enum object_type type;
3249-
unsigned long size;
3249+
size_t size;
32503250
char *result;
32513251

32523252
result = odb_read_object(the_repository->objects, &oid,
@@ -3309,7 +3309,7 @@ static int read_blob_object(struct strbuf *buf, const struct object_id *oid, uns
33093309
strbuf_addf(buf, "Subproject commit %s\n", oid_to_hex(oid));
33103310
} else {
33113311
enum object_type type;
3312-
unsigned long sz;
3312+
size_t sz;
33133313
char *result;
33143314

33153315
result = odb_read_object(the_repository->objects, oid,
@@ -3536,7 +3536,7 @@ static int load_preimage(struct apply_state *state,
35363536

35373537
static int resolve_to(struct image *image, const struct object_id *result_id)
35383538
{
3539-
unsigned long size;
3539+
size_t size;
35403540
enum object_type type;
35413541
char *data;
35423542

archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ static void *object_file_to_archive(const struct archiver_args *args,
8787
const struct object_id *oid,
8888
unsigned int mode,
8989
enum object_type *type,
90-
unsigned long *sizep)
90+
size_t *sizep)
9191
{
9292
void *buffer;
9393
const struct commit *commit = args->convert ? args->commit : NULL;
@@ -158,7 +158,7 @@ static int write_archive_entry(const struct object_id *oid, const char *base,
158158
write_archive_entry_fn_t write_entry = c->write_entry;
159159
int err;
160160
const char *path_without_prefix;
161-
unsigned long size;
161+
size_t size;
162162
void *buffer;
163163
enum object_type type;
164164

attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ static struct attr_stack *read_attr_from_blob(struct index_state *istate,
768768
const char *path, unsigned flags)
769769
{
770770
struct object_id oid;
771-
unsigned long sz;
771+
size_t sz;
772772
enum object_type type;
773773
void *buf;
774774
unsigned short mode;

bisect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static void show_list(const char *debug, int counted, int nr,
154154
struct commit *commit = p->item;
155155
unsigned commit_flags = commit->object.flags;
156156
enum object_type type;
157-
unsigned long size;
157+
size_t size;
158158
char *buf = odb_read_object(the_repository->objects,
159159
&commit->object.oid, &type,
160160
&size);

blame.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static struct commit *fake_working_tree_commit(struct repository *r,
238238
struct stat st;
239239
const char *read_from;
240240
char *buf_ptr;
241-
unsigned long buf_len;
241+
size_t buf_len;
242242

243243
if (contents_from) {
244244
if (stat(contents_from, &st) < 0)
@@ -1034,7 +1034,7 @@ static void fill_origin_blob(struct diff_options *opt,
10341034
{
10351035
if (!o->file.ptr) {
10361036
enum object_type type;
1037-
unsigned long file_size;
1037+
size_t file_size;
10381038

10391039
(*num_read_blob)++;
10401040
if (opt->flags.allow_textconv &&

blame.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ struct blame_scoreboard {
117117
* indexed with scoreboard.lineno[blame_entry.lno].
118118
*/
119119
char *final_buf;
120-
unsigned long final_buf_size;
120+
size_t final_buf_size;
121121

122122
/* linked list of blames */
123123
struct blame_entry *ent;

builtin/cat-file.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static char *replace_idents_using_mailmap(char *object_buf, size_t *size)
7070

7171
static int filter_object(const char *path, unsigned mode,
7272
const struct object_id *oid,
73-
char **buf, unsigned long *size)
73+
char **buf, size_t *size)
7474
{
7575
enum object_type type;
7676

@@ -106,7 +106,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
106106
struct object_id oid;
107107
enum object_type type;
108108
char *buf;
109-
unsigned long size;
109+
size_t size;
110110
struct object_context obj_context = {0};
111111
struct object_info oi = OBJECT_INFO_INIT;
112112
unsigned flags = OBJECT_INFO_LOOKUP_REPLACE;
@@ -274,7 +274,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name)
274274
struct expand_data {
275275
struct object_id oid;
276276
enum object_type type;
277-
unsigned long size;
277+
size_t size;
278278
unsigned short mode;
279279
off_t disk_size;
280280
const char *rest;
@@ -391,7 +391,7 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
391391
fflush(stdout);
392392
if (opt->transform_mode) {
393393
char *contents;
394-
unsigned long size;
394+
size_t size;
395395

396396
if (!data->rest)
397397
die("missing path for '%s'", oid_to_hex(oid));
@@ -421,7 +421,7 @@ static void print_object_or_die(struct batch_options *opt, struct expand_data *d
421421
}
422422
else {
423423
enum object_type type;
424-
unsigned long size;
424+
size_t size;
425425
void *contents;
426426

427427
contents = odb_read_object(the_repository->objects, oid,

builtin/difftool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static char *get_symlink(struct repository *repo,
319319
data = strbuf_detach(&link, NULL);
320320
} else {
321321
enum object_type type;
322-
unsigned long size;
322+
size_t size;
323323
data = odb_read_object(repo->objects, oid, &type, &size);
324324
if (!data)
325325
die(_("could not read object %s for symlink %s"),

builtin/fast-export.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static void show_progress(void)
284284
* There's no need to cache this result with anonymize_mem, since
285285
* we already handle blob content caching with marks.
286286
*/
287-
static char *anonymize_blob(unsigned long *size)
287+
static char *anonymize_blob(size_t *size)
288288
{
289289
static int counter;
290290
struct strbuf out = STRBUF_INIT;
@@ -295,7 +295,7 @@ static char *anonymize_blob(unsigned long *size)
295295

296296
static void export_blob(const struct object_id *oid)
297297
{
298-
unsigned long size;
298+
size_t size;
299299
enum object_type type;
300300
char *buf;
301301
struct object *object;
@@ -882,7 +882,7 @@ static char *anonymize_tag(void)
882882

883883
static void handle_tag(const char *name, struct tag *tag)
884884
{
885-
unsigned long size;
885+
size_t size;
886886
enum object_type type;
887887
char *buf;
888888
const char *tagger, *tagger_end, *message;

builtin/fast-import.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -960,7 +960,8 @@ static int store_object(
960960
struct object_entry *e;
961961
unsigned char hdr[96];
962962
struct object_id oid;
963-
unsigned long hdrlen, deltalen;
963+
unsigned long hdrlen;
964+
size_t deltalen;
964965
struct git_hash_ctx c;
965966
git_zstream s;
966967

@@ -1221,7 +1222,7 @@ static void stream_blob(uintmax_t len, struct object_id *oidout, uintmax_t mark)
12211222
*/
12221223
static void *gfi_unpack_entry(
12231224
struct object_entry *oe,
1224-
unsigned long *sizep)
1225+
size_t *sizep)
12251226
{
12261227
enum object_type type;
12271228
struct packed_git *p = all_packs[oe->pack_id];
@@ -1253,7 +1254,7 @@ static void load_tree(struct tree_entry *root)
12531254
struct object_id *oid = &root->versions[1].oid;
12541255
struct object_entry *myoe;
12551256
struct tree_content *t;
1256-
unsigned long size;
1257+
size_t size;
12571258
char *buf;
12581259
const char *c;
12591260

@@ -2540,7 +2541,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
25402541
die(_("mark :%" PRIuMAX " not a commit"), commit_mark);
25412542
oidcpy(&commit_oid, &commit_oe->idx.oid);
25422543
} else if (!repo_get_oid(the_repository, p, &commit_oid)) {
2543-
unsigned long size;
2544+
size_t size;
25442545
char *buf = odb_read_object_peeled(the_repository->objects,
25452546
&commit_oid, OBJ_COMMIT, &size,
25462547
&commit_oid);
@@ -2606,7 +2607,7 @@ static void parse_from_existing(struct branch *b)
26062607
oidclr(&b->branch_tree.versions[0].oid, the_repository->hash_algo);
26072608
oidclr(&b->branch_tree.versions[1].oid, the_repository->hash_algo);
26082609
} else {
2609-
unsigned long size;
2610+
size_t size;
26102611
char *buf;
26112612

26122613
buf = odb_read_object_peeled(the_repository->objects, &b->oid,
@@ -2639,7 +2640,7 @@ static int parse_objectish(struct branch *b, const char *objectish)
26392640
if (!oideq(&b->oid, &oe->idx.oid)) {
26402641
oidcpy(&b->oid, &oe->idx.oid);
26412642
if (oe->pack_id != MAX_PACK_ID) {
2642-
unsigned long size;
2643+
size_t size;
26432644
char *buf = gfi_unpack_entry(oe, &size);
26442645
parse_from_commit(b, buf, size);
26452646
free(buf);
@@ -2702,7 +2703,7 @@ static struct hash_list *parse_merge(unsigned int *count)
27022703
die(_("mark :%" PRIuMAX " not a commit"), idnum);
27032704
oidcpy(&n->oid, &oe->idx.oid);
27042705
} else if (!repo_get_oid(the_repository, from, &n->oid)) {
2705-
unsigned long size;
2706+
size_t size;
27062707
char *buf = odb_read_object_peeled(the_repository->objects,
27072708
&n->oid, OBJ_COMMIT,
27082709
&size, &n->oid);
@@ -3201,7 +3202,7 @@ static void cat_blob_write(const char *buf, unsigned long size)
32013202
static void cat_blob(struct object_entry *oe, struct object_id *oid)
32023203
{
32033204
struct strbuf line = STRBUF_INIT;
3204-
unsigned long size;
3205+
size_t size;
32053206
enum object_type type = 0;
32063207
char *buf;
32073208

@@ -3285,7 +3286,7 @@ static void parse_cat_blob(const char *p)
32853286
static struct object_entry *dereference(struct object_entry *oe,
32863287
struct object_id *oid)
32873288
{
3288-
unsigned long size;
3289+
size_t size;
32893290
char *buf = NULL;
32903291
const unsigned hexsz = the_hash_algo->hexsz;
32913292

0 commit comments

Comments
 (0)