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

[PATCH v2 07/10] push_refs_with_export: convert to struct object_id

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 13, 2015, 22:16 UTC
Message-ID
<1434233803-422442-8-git-send-email-sandals@crustytoothpaste.net>
In-Reply-To
<1434233803-422442-1-git-send-email-sandals@crustytoothpaste.net>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 transport-helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/transport-helper.c b/transport-helper.c
index 4ca3e80..1f28b82 100644
--- a/transport-helper.c
+++ b/transport-helper.c
@@ -877,13 +877,13 @@ static int push_refs_with_export(struct transport *transport,
 
 	for (ref = remote_refs; ref; ref = ref->next) {
 		char *private;
-		unsigned char sha1[20];
+		struct object_id oid;
 
 		private = apply_refspecs(data->refspecs, data->refspec_nr, ref->name);
-		if (private && !get_sha1(private, sha1)) {
+		if (private && !get_sha1(private, oid.hash)) {
 			strbuf_addf(&buf, "^%s", private);
 			string_list_append(&revlist_args, strbuf_detach(&buf, NULL));
-			hashcpy(ref->old_oid.hash, sha1);
+			oidcpy(&ref->old_oid, &oid);
 		}
 		free(private);
 
@@ -897,7 +897,7 @@ static int push_refs_with_export(struct transport *transport,
 					name = resolve_ref_unsafe(
 						 ref->peer_ref->name,
 						 RESOLVE_REF_READING,
-						 sha1, &flag);
+						 oid.hash, &flag);
 					if (!name || !(flag & REF_ISSYMREF))
 						name = ref->peer_ref->name;
 
-- 
2.4.0
Previous: brian m. carlsonNext: brian m. carlson
Message 9 of 13 in “object_id part 2”
  1. 00/10 object_id part 2brian m. carlson, Jun 13, 2015
  2. 01/10 refs: convert some internal functions to use object_idbrian m. carlson, Jun 13, 2015
  3. 02/10 sha1_file: introduce has_object_file helper.brian m. carlson, Jun 13, 2015
  4. 03/10 Convert struct ref to use object_id.brian m. carlson, Jun 13, 2015
  5. Junio C HamanoJun 15, 2015
  6. 04/10 add_sought_entry_mem: convert to struct object_idbrian m. carlson, Jun 13, 2015
  7. 05/10 parse_fetch: convert to use struct object_idbrian m. carlson, Jun 13, 2015
  8. 06/10 get_remote_heads: convert to struct object_idbrian m. carlson, Jun 13, 2015
  9. 07/10 push_refs_with_export: convert to struct object_idbrian m. carlson, Jun 13, 2015
  10. 08/10 ref_newer: convert to use struct object_idbrian m. carlson, Jun 13, 2015
  11. 10/10 remote: convert functions to struct object_idbrian m. carlson, Jun 13, 2015
  12. Michael HaggertyAug 2, 2015
  13. brian m. carlsonAug 3, 2015

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.