git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 10/12] Convert remaining callers of get_sha1 to get_oid.

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jul 3, 2017, 18:55 UTC
Message-ID
<20170703185533.51530-11-sandals@crustytoothpaste.net>
In-Reply-To
<20170703185533.51530-1-sandals@crustytoothpaste.net>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 builtin/receive-pack.c | 4 ++--
 mailmap.c              | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 71c0c768d..1efa48fec 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -919,9 +919,9 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
  */
 static int head_has_history(void)
 {
-	unsigned char sha1[20];
+	struct object_id oid;
 
-	return !get_sha1("HEAD", sha1);
+	return !get_oid("HEAD", &oid);
 }
 
 static const char *push_to_deploy(unsigned char *sha1,
diff --git a/mailmap.c b/mailmap.c
index c1a79c100..cb921b4db 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -214,17 +214,17 @@ static int read_mailmap_blob(struct string_list *map,
 			     const char *name,
 			     char **repo_abbrev)
 {
-	unsigned char sha1[20];
+	struct object_id oid;
 	char *buf;
 	unsigned long size;
 	enum object_type type;
 
 	if (!name)
 		return 0;
-	if (get_sha1(name, sha1) < 0)
+	if (get_oid(name, &oid) < 0)
 		return 0;
 
-	buf = read_sha1_file(sha1, &type, &size);
+	buf = read_sha1_file(oid.hash, &type, &size);
 	if (!buf)
 		return error("unable to read mailmap object at %s", name);
 	if (type != OBJ_BLOB)
Previous: brian m. carlsonNext: brian m. carlson
Message 8 of 20 in “object_id part 9”
  1. 00/12 object_id part 9brian m. carlson, Jul 3, 2017
  2. 01/12 builtin/fsck: convert remaining caller of get_sha1 to object_idbrian m. carlson, Jul 3, 2017
  3. 07/12 bisect: convert bisect_checkout to struct object_idbrian m. carlson, Jul 3, 2017
  4. 05/12 sequencer: convert to struct object_idbrian m. carlson, Jul 3, 2017
  5. 04/12 remote: convert struct push_cas to struct object_idbrian m. carlson, Jul 3, 2017
  6. 02/12 builtin/merge-tree: convert remaining caller of get_sha1 to object_idbrian m. carlson, Jul 3, 2017
  7. 08/12 builtin/unpack-file: convert to struct object_idbrian m. carlson, Jul 3, 2017
  8. 10/12 Convert remaining callers of get_sha1 to get_oid.brian m. carlson, Jul 3, 2017
  9. 06/12 builtin/update_ref: convert to struct object_idbrian m. carlson, Jul 3, 2017
  10. Ævar Arnfjörð BjarmasonJul 3, 2017
  11. brian m. carlsonJul 4, 2017
  12. 03/12 submodule: convert submodule config lookup to use object_idbrian m. carlson, Jul 3, 2017
  13. 09/12 builtin/verify-tag: convert to struct object_idbrian m. carlson, Jul 3, 2017
  14. 12/12 sha1_name: convert GET_SHA1* flags to GET_OID*brian m. carlson, Jul 3, 2017
  15. 11/12 sha1_name: convert get_sha1* to get_oid*brian m. carlson, Jul 3, 2017
  16. Stefan BellerJul 5, 2017
  17. Junio C HamanoJul 5, 2017
  18. brian m. carlsonJul 7, 2017
  19. Junio C HamanoJul 5, 2017
  20. Stefan BellerJul 5, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.