summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-05-06 22:10:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-08 06:12:57 (GMT)
commite92b848cb6a77172d2fbd2bda39a32e371d40eea (patch)
tree57161abfe9d8b50f2c4af07fd0bb363444eccd75 /builtin
parent68ab61dd099a2ce9f700fa68b9b7cc7722304407 (diff)
downloadgit-e92b848cb6a77172d2fbd2bda39a32e371d40eea.zip
git-e92b848cb6a77172d2fbd2bda39a32e371d40eea.tar.gz
git-e92b848cb6a77172d2fbd2bda39a32e371d40eea.tar.bz2
shallow: convert shallow registration functions to object_id
Convert register_shallow and unregister_shallow to take struct object_id. register_shallow is a caller of lookup_commit, which we will convert later. It doesn't make sense for the registration and unregistration functions to have incompatible interfaces, so convert them both. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/pack-objects.c6
-rw-r--r--builtin/receive-pack.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 0fe35d1..4770708 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2777,10 +2777,10 @@ static void get_object_list(int ac, const char **av)
continue;
}
if (starts_with(line, "--shallow ")) {
- unsigned char sha1[20];
- if (get_sha1_hex(line + 10, sha1))
+ struct object_id oid;
+ if (get_oid_hex(line + 10, &oid))
die("not an SHA-1 '%s'", line + 10);
- register_shallow(sha1);
+ register_shallow(&oid);
use_bitmap_index = 0;
continue;
}
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index f96834f..6f0f788 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -858,7 +858,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
* not lose these new roots..
*/
for (i = 0; i < extra.nr; i++)
- register_shallow(extra.oid[i].hash);
+ register_shallow(&extra.oid[i]);
si->shallow_ref[cmd->index] = 0;
oid_array_clear(&extra);