summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorPatryk Obara <patryk.obara@gmail.com>2018-01-28 00:13:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-01-30 18:42:36 (GMT)
commit4bdb70a4f73369af39989a3ab5732825600dc914 (patch)
treec1732a9cf1b5cb25f3463fbc81887fbbc05854be /sha1_file.c
parenta09c985eae694db1cf31c72db0e2e1bf42f1274f (diff)
downloadgit-4bdb70a4f73369af39989a3ab5732825600dc914.zip
git-4bdb70a4f73369af39989a3ab5732825600dc914.tar.gz
git-4bdb70a4f73369af39989a3ab5732825600dc914.tar.bz2
sha1_file: convert force_object_loose to object_id
Convert the definition and declaration of force_object_loose to struct object_id and adjust usage of this function. Signed-off-by: Patryk Obara <patryk.obara@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c
index d1569b1..d9ee966 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1670,7 +1670,7 @@ cleanup:
return status;
}
-int force_object_loose(const unsigned char *sha1, time_t mtime)
+int force_object_loose(const struct object_id *oid, time_t mtime)
{
void *buf;
unsigned long len;
@@ -1679,13 +1679,13 @@ int force_object_loose(const unsigned char *sha1, time_t mtime)
int hdrlen;
int ret;
- if (has_loose_object(sha1))
+ if (has_loose_object(oid->hash))
return 0;
- buf = read_object(sha1, &type, &len);
+ buf = read_object(oid->hash, &type, &len);
if (!buf)
- return error("cannot read sha1_file for %s", sha1_to_hex(sha1));
+ return error("cannot read sha1_file for %s", oid_to_hex(oid));
hdrlen = xsnprintf(hdr, sizeof(hdr), "%s %lu", typename(type), len) + 1;
- ret = write_loose_object(sha1, hdr, hdrlen, buf, len, mtime);
+ ret = write_loose_object(oid->hash, hdr, hdrlen, buf, len, mtime);
free(buf);
return ret;