Merge branch 'ag/rebase-i-in-c' into js/rebase-in-c-5.5-work-with-rebase-i-in-c
[gitweb.git] / refs / files-backend.c
index 054306d7796670d6e6049074f501568c3eadaa58..b9eb3aabe6388a6437109439c3ac2ca298853892 100644 (file)
@@ -1651,7 +1651,7 @@ static int write_ref_to_lockfile(struct ref_lock *lock,
        struct object *o;
        int fd;
 
-       o = parse_object(oid);
+       o = parse_object(the_repository, oid);
        if (!o) {
                strbuf_addf(err,
                            "trying to write ref '%s' with nonexistent object %s",
@@ -1667,7 +1667,7 @@ static int write_ref_to_lockfile(struct ref_lock *lock,
                return -1;
        }
        fd = get_lock_file_fd(&lock->lk);
-       if (write_in_full(fd, oid_to_hex(oid), GIT_SHA1_HEXSZ) < 0 ||
+       if (write_in_full(fd, oid_to_hex(oid), the_hash_algo->hexsz) < 0 ||
            write_in_full(fd, &term, 1) < 0 ||
            close_ref_gently(lock) < 0) {
                strbuf_addf(err,
@@ -3061,7 +3061,7 @@ static int files_reflog_expire(struct ref_store *ref_store,
                        rollback_lock_file(&reflog_lock);
                } else if (update &&
                           (write_in_full(get_lock_file_fd(&lock->lk),
-                               oid_to_hex(&cb.last_kept_oid), GIT_SHA1_HEXSZ) < 0 ||
+                               oid_to_hex(&cb.last_kept_oid), the_hash_algo->hexsz) < 0 ||
                            write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 ||
                            close_ref_gently(lock) < 0)) {
                        status |= error("couldn't write %s",