From: Brad Roberts <braddr@gameboy2.puremagic.com>
To: git@vger.kernel.org
Subject: [PATCH 01/19] write_cache api signature change, isolate active_cache and active_nr inside read-cache.c
Date: Thu, 21 Apr 2005 11:34:42 -0700 [thread overview]
Message-ID: <200504211834.j3LIYg1j026811@gameboy2.puremagic.com> (raw)
tree f45fd10b26bf98349b63427805a96bd0551cad74
parent 43fdf65356c50483233cb3d6e391b0849b2a2a50
parent cd1c034369b73da7503da365fa556aab27004814
author Brad Roberts <braddr@puremagic.com> 1114072582 -0700
committer Brad Roberts <braddr@gameboy2.puremagic.com> 1114072582 -0700
[PATCH] write_cache api signature change, isolate active_cache and active_nr inside read-cache.c
Signed-off-by: Brad Roberts <braddr@puremagic.com>
---
cache.h | 2 +-
read-cache.c | 8 ++++----
read-tree.c | 2 +-
update-cache.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
Index: cache.h
===================================================================
--- cd1c034369b73da7503da365fa556aab27004814:1/cache.h (mode:100644 sha1:828d660ab82bb35a1ca632a2ba4620dc483889bd)
+++ 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/cache.h (mode:100644 sha1:a101870e4a002a2548d88544a77bedad21668203)
@@ -88,7 +88,7 @@
/* Initialize and use the cache information */
extern int read_cache(void);
-extern int write_cache(int newfd, struct cache_entry **cache, int entries);
+extern int write_cache(int newfd);
extern int cache_name_pos(const char *name, int namelen);
extern int add_cache_entry(struct cache_entry *ce, int ok_to_add);
extern int remove_file_from_cache(char *path);
Index: read-cache.c
===================================================================
--- cd1c034369b73da7503da365fa556aab27004814:1/read-cache.c (mode:100644 sha1:2f6a4aa18d48865db80459a3459ac4384b0b16c8)
+++ 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/read-cache.c (mode:100644 sha1:349ebd1f8a0a95bf462bb1dfd3d9dfb50628829c)
@@ -267,7 +267,7 @@
return 0;
}
-int write_cache(int newfd, struct cache_entry **cache, int entries)
+int write_cache(int newfd)
{
SHA_CTX c;
struct cache_header hdr;
@@ -275,14 +275,14 @@
hdr.hdr_signature = htonl(CACHE_SIGNATURE);
hdr.hdr_version = htonl(2);
- hdr.hdr_entries = htonl(entries);
+ hdr.hdr_entries = htonl(active_nr);
SHA1_Init(&c);
if (ce_write(&c, newfd, &hdr, sizeof(hdr)) < 0)
return -1;
- for (i = 0; i < entries; i++) {
- struct cache_entry *ce = cache[i];
+ for (i = 0; i < active_nr; i++) {
+ struct cache_entry *ce = active_cache[i];
if (ce_write(&c, newfd, ce, ce_size(ce)) < 0)
return -1;
}
Index: read-tree.c
===================================================================
--- cd1c034369b73da7503da365fa556aab27004814:1/read-tree.c (mode:100644 sha1:620f3f74eb56366fca8be4d28d7b04875c0fa90c)
+++ 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/read-tree.c (mode:100644 sha1:4ad48f5c409ead69407d2b5feab4466cdcb499f8)
@@ -261,7 +261,7 @@
die("just how do you expect me to merge %d trees?", stage-1);
}
}
- if (write_cache(newfd, active_cache, active_nr) ||
+ if (write_cache(newfd) ||
rename(".git/index.lock", ".git/index"))
die("unable to write new index file");
remove_lock = 0;
Index: update-cache.c
===================================================================
--- cd1c034369b73da7503da365fa556aab27004814:1/update-cache.c (mode:100644 sha1:a09883541c745c76413c62109a80f40df4b7a7fb)
+++ 77de9e0b7a81ddc22526c9415f0273171f631d3f:1/update-cache.c (mode:100644 sha1:585951108c57a64bb774114d289d81fd7fd22768)
@@ -341,7 +341,7 @@
if (add_file_to_cache(path))
die("Unable to add %s to database", path);
}
- if (write_cache(newfd, active_cache, active_nr) ||
+ if (write_cache(newfd) ||
rename(".git/index.lock", ".git/index"))
die("Unable to write new cachefile");
reply other threads:[~2005-04-21 18:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504211834.j3LIYg1j026811@gameboy2.puremagic.com \
--to=braddr@gameboy2.puremagic.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox