From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: Brandon Williams <bmwill@google.com>,
Stefan Beller <stefanbeller@gmail.com>, Jeff King <peff@peff.net>
Subject: [PATCH 08/12] builtin/unpack-file: convert to struct object_id
Date: Mon, 3 Jul 2017 18:55:29 +0000 [thread overview]
Message-ID: <20170703185533.51530-9-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20170703185533.51530-1-sandals@crustytoothpaste.net>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
builtin/unpack-file.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 73f133419..281ca1db6 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,7 +1,7 @@
#include "builtin.h"
#include "config.h"
-static char *create_temp_file(unsigned char *sha1)
+static char *create_temp_file(struct object_id *oid)
{
static char path[50];
void *buf;
@@ -9,9 +9,9 @@ static char *create_temp_file(unsigned char *sha1)
unsigned long size;
int fd;
- buf = read_sha1_file(sha1, &type, &size);
+ buf = read_sha1_file(oid->hash, &type, &size);
if (!buf || type != OBJ_BLOB)
- die("unable to read blob object %s", sha1_to_hex(sha1));
+ die("unable to read blob object %s", oid_to_hex(oid));
xsnprintf(path, sizeof(path), ".merge_file_XXXXXX");
fd = xmkstemp(path);
@@ -23,15 +23,15 @@ static char *create_temp_file(unsigned char *sha1)
int cmd_unpack_file(int argc, const char **argv, const char *prefix)
{
- unsigned char sha1[20];
+ struct object_id oid;
if (argc != 2 || !strcmp(argv[1], "-h"))
usage("git unpack-file <sha1>");
- if (get_sha1(argv[1], sha1))
+ if (get_oid(argv[1], &oid))
die("Not a valid object name %s", argv[1]);
git_config(git_default_config, NULL);
- puts(create_temp_file(sha1));
+ puts(create_temp_file(&oid));
return 0;
}
next prev parent reply other threads:[~2017-07-03 18:56 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-03 18:55 [PATCH 00/12] object_id part 9 brian m. carlson
2017-07-03 18:55 ` [PATCH 01/12] builtin/fsck: convert remaining caller of get_sha1 to object_id brian m. carlson
2017-07-03 18:55 ` [PATCH 02/12] builtin/merge-tree: " brian m. carlson
2017-07-03 18:55 ` [PATCH 03/12] submodule: convert submodule config lookup to use object_id brian m. carlson
2017-07-03 18:55 ` [PATCH 04/12] remote: convert struct push_cas to struct object_id brian m. carlson
2017-07-03 18:55 ` [PATCH 05/12] sequencer: convert " brian m. carlson
2017-07-03 18:55 ` [PATCH 06/12] builtin/update_ref: " brian m. carlson
2017-07-03 20:49 ` Ævar Arnfjörð Bjarmason
2017-07-04 14:45 ` brian m. carlson
2017-07-03 18:55 ` [PATCH 07/12] bisect: convert bisect_checkout " brian m. carlson
2017-07-03 18:55 ` brian m. carlson [this message]
2017-07-03 18:55 ` [PATCH 09/12] builtin/verify-tag: convert " brian m. carlson
2017-07-03 18:55 ` [PATCH 10/12] Convert remaining callers of get_sha1 to get_oid brian m. carlson
2017-07-03 18:55 ` [PATCH 11/12] sha1_name: convert get_sha1* to get_oid* brian m. carlson
2017-07-05 18:01 ` Stefan Beller
2017-07-05 18:38 ` Junio C Hamano
2017-07-07 21:22 ` brian m. carlson
2017-07-03 18:55 ` [PATCH 12/12] sha1_name: convert GET_SHA1* flags to GET_OID* brian m. carlson
2017-07-05 4:10 ` [PATCH 00/12] object_id part 9 Junio C Hamano
2017-07-05 18:02 ` Stefan Beller
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170703185533.51530-9-sandals@crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=bmwill@google.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=stefanbeller@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).