git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Subject: [PATCH 2/6] test-match-trees: convert to use struct object_id
Date: Sun, 17 Apr 2016 23:10:37 +0000	[thread overview]
Message-ID: <1460934641-435791-3-git-send-email-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <1460934641-435791-1-git-send-email-sandals@crustytoothpaste.net>

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 test-match-trees.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/test-match-trees.c b/test-match-trees.c
index 4dad7095..41aff841 100644
--- a/test-match-trees.c
+++ b/test-match-trees.c
@@ -3,24 +3,24 @@
 
 int main(int ac, char **av)
 {
-	unsigned char hash1[20], hash2[20], shifted[20];
+	struct object_id hash1, hash2, shifted;
 	struct tree *one, *two;
 
 	setup_git_directory();
 
-	if (get_sha1(av[1], hash1))
+	if (get_oid(av[1], &hash1))
 		die("cannot parse %s as an object name", av[1]);
-	if (get_sha1(av[2], hash2))
+	if (get_oid(av[2], &hash2))
 		die("cannot parse %s as an object name", av[2]);
-	one = parse_tree_indirect(hash1);
+	one = parse_tree_indirect(hash1.hash);
 	if (!one)
 		die("not a tree-ish %s", av[1]);
-	two = parse_tree_indirect(hash2);
+	two = parse_tree_indirect(hash2.hash);
 	if (!two)
 		die("not a tree-ish %s", av[2]);
 
-	shift_tree(one->object.oid.hash, two->object.oid.hash, shifted, -1);
-	printf("shifted: %s\n", sha1_to_hex(shifted));
+	shift_tree(one->object.oid.hash, two->object.oid.hash, shifted.hash, -1);
+	printf("shifted: %s\n", oid_to_hex(&shifted));
 
 	exit(0);
 }
-- 
2.8.0.rc3.226.g39d4020

  parent reply	other threads:[~2016-04-18  2:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-17 23:10 [PATCH 0/6] object_id Part 3 brian m. carlson
2016-04-17 23:10 ` [PATCH 1/6] Introduce a get_oid function brian m. carlson
2016-04-17 23:10 ` brian m. carlson [this message]
2016-04-17 23:10 ` [PATCH 3/6] match-trees: convert shift_tree and shift_tree_by to object_id brian m. carlson
2016-04-17 23:10 ` [PATCH 4/6] Convert struct name_entry to use struct object_id brian m. carlson
2016-04-19 23:02   ` Junio C Hamano
2016-04-19 23:16     ` brian m. carlson
2016-04-20  0:17       ` Junio C Hamano
2016-04-17 23:10 ` [PATCH 5/6] tree-walk: convert tree_entry_extract to " brian m. carlson
2016-04-17 23:10 ` [PATCH 6/6] match-trees: convert several leaf functions " brian m. carlson

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=1460934641-435791-3-git-send-email-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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;
as well as URLs for NNTP newsgroup(s).