Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-02-22 02:47:35 +0300
committerJunio C Hamano <gitster@pobox.com>2017-02-22 21:12:15 +0300
commit76c1d9a09624ae39fa9e3140f6581e672b9c040a (patch)
treeb146b591ad3123bcb93f66787e216c4bfd630e1e /builtin/prune.c
parent068f85e31311f521adffbcbf96f6583206d77b7d (diff)
Convert object iteration callbacks to struct object_id
Convert each_loose_object_fn and each_packed_object_fn to take a pointer to struct object_id. Update the various callbacks. Convert several 40-based constants to use GIT_SHA1_HEXSZ. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r--builtin/prune.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/prune.c b/builtin/prune.c
index 8f4f0522856..42633e0c6e6 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -30,7 +30,7 @@ static int prune_tmp_file(const char *fullpath)
return 0;
}
-static int prune_object(const unsigned char *sha1, const char *fullpath,
+static int prune_object(const struct object_id *oid, const char *fullpath,
void *data)
{
struct stat st;
@@ -39,7 +39,7 @@ static int prune_object(const unsigned char *sha1, const char *fullpath,
* Do we know about this object?
* It must have been reachable
*/
- if (lookup_object(sha1))
+ if (lookup_object(oid->hash))
return 0;
if (lstat(fullpath, &st)) {
@@ -50,8 +50,8 @@ static int prune_object(const unsigned char *sha1, const char *fullpath,
if (st.st_mtime > expire)
return 0;
if (show_only || verbose) {
- enum object_type type = sha1_object_info(sha1, NULL);
- printf("%s %s\n", sha1_to_hex(sha1),
+ enum object_type type = sha1_object_info(oid->hash, NULL);
+ printf("%s %s\n", oid_to_hex(oid),
(type > 0) ? typename(type) : "unknown");
}
if (!show_only)