summaryrefslogtreecommitdiff
path: root/shallow.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-01-28 06:12:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-28 19:21:07 (GMT)
commit98c431b6f9c767657e1c8cb57370fd1db82b341e (patch)
treedb31752bd7090672b3eea34e694697e80179760c /shallow.c
parente6362826a0409539642a5738db61827e5978e2e4 (diff)
downloadgit-98c431b6f9c767657e1c8cb57370fd1db82b341e.zip
git-98c431b6f9c767657e1c8cb57370fd1db82b341e.tar.gz
git-98c431b6f9c767657e1c8cb57370fd1db82b341e.tar.bz2
commit_graft_pos(): take an oid instead of a bare hash
All of our callers have an object_id, and are just dereferencing the hash field to pass to us. Let's take the actual object_id instead. We still access the hash to pass to hash_pos, but it's a step in the right direction. This makes the callers slightly simpler, but also gets rid of the untyped pointer, as well as the now-inaccurate name "sha1". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'shallow.c')
-rw-r--r--shallow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shallow.c b/shallow.c
index 91b9e10..9ed18eb 100644
--- a/shallow.c
+++ b/shallow.c
@@ -41,7 +41,7 @@ int register_shallow(struct repository *r, const struct object_id *oid)
int unregister_shallow(const struct object_id *oid)
{
- int pos = commit_graft_pos(the_repository, oid->hash);
+ int pos = commit_graft_pos(the_repository, oid);
if (pos < 0)
return -1;
if (pos + 1 < the_repository->parsed_objects->grafts_nr)