Add support for mempack #448

Merged
lhchavez merged 4 commits from mempack into master 2019-01-15 13:46:55 -06:00
2 changed files with 144 additions and 0 deletions

84
mempack.go Normal file
View File

@ -0,0 +1,84 @@
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
package git
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
/*
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
#include <git2.h>
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
#include <git2/sys/mempack.h>
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
extern int git_mempack_new(git_odb_backend **out);
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
extern int git_mempack_dump(git_buf *pack, git_repository *repo, git_odb_backend *backend);
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
extern void git_mempack_reset(git_odb_backend *backend);
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
extern void _go_git_odb_backend_free(git_odb_backend *backend);
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
*/
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
import "C"
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
import (
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
"runtime"
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
"unsafe"
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Mempack is a custom ODB backend that permits packing object in-memory.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
type Mempack struct {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
ptr *C.git_odb_backend
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// NewMempack creates a new mempack instance and registers it to the ODB.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
func NewMempack(odb *Odb) (mempack *Mempack, err error) {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
mempack = new(Mempack)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
runtime.LockOSThread()
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
defer runtime.UnlockOSThread()
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
ret := C.git_mempack_new(&mempack.ptr)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
if ret < 0 {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
return nil, MakeGitError(ret)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
ret = C.git_odb_add_backend(odb.ptr, mempack.ptr, C.int(999))
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
runtime.KeepAlive(odb)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
if ret < 0 {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Since git_odb_add_alternate() takes ownership of the ODB backend, the
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// only case in which we free the mempack's memory is if it fails to be
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// added to the ODB.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
C._go_git_odb_backend_free(mempack.ptr)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
return nil, MakeGitError(ret)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
return mempack, nil
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Dump dumps all the queued in-memory writes to a packfile.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
//
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// It is the caller's responsibility to ensure that the generated packfile is
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// available to the repository (e.g. by writing it to disk, or doing something
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// crazy like distributing it across several copies of the repository over a
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// network).
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
//
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Once the generated packfile is available to the repository, call
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Mempack.Reset to cleanup the memory store.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
//
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Calling Mempack.Reset before the packfile has been written to disk will
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// result in an inconsistent repository (the objects in the memory store won't
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// be accessible).
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
func (mempack *Mempack) Dump(repository *Repository) ([]byte, error) {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
buf := C.git_buf{}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
runtime.LockOSThread()
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
defer runtime.UnlockOSThread()
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
ret := C.git_mempack_dump(&buf, repository.ptr, mempack.ptr)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
runtime.KeepAlive(repository)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
if ret < 0 {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
return nil, MakeGitError(ret)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:14:42 -06:00 (Migrated from github.com)
Review

We need to keep repository alive until here, or the runtime might free it.

We need to keep `repository` alive until here, or the runtime might free it.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:16 -06:00 (Migrated from github.com)
Review

Done

Done
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
defer C.git_buf_dispose(&buf)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
return C.GoBytes(unsafe.Pointer(buf.ptr), C.int(buf.size)), nil
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// Reset resets the memory packer by clearing all the queued objects.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
//
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// This assumes that Mempack.Dump has been called before to store all the
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
// queued objects into a single packfile.
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
func (mempack *Mempack) Reset() {
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
C.git_mempack_reset(mempack.ptr)
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.
}
carlosmn commented 2019-01-07 15:12:49 -06:00 (Migrated from github.com)
Review

This still needs to actually free the mempack, not just unset the finalizer.

This still needs to actually free the mempack, not just unset the finalizer.
carlosmn commented 2019-01-07 15:13:26 -06:00 (Migrated from github.com)
Review

We only need to lock the thread if we're going to deal with errors.

We only need to lock the thread if we're going to deal with errors.
carlosmn commented 2019-01-07 15:15:35 -06:00 (Migrated from github.com)
Review

The free should happen inside Mempack.Free.

The free should happen inside `Mempack.Free`.
lhchavez commented 2019-01-07 20:46:07 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:23 -06:00 (Migrated from github.com)
Review

Removed

Removed
lhchavez commented 2019-01-07 20:46:29 -06:00 (Migrated from github.com)
Review

Removed.

Removed.

60
mempack_test.go Normal file
View File

@ -0,0 +1,60 @@
package git
import (
"bytes"
"testing"
)
func TestMempack(t *testing.T) {
t.Parallel()
odb, err := NewOdb()
checkFatal(t, err)
repo, err := NewRepositoryWrapOdb(odb)
checkFatal(t, err)
mempack, err := NewMempack(odb)
checkFatal(t, err)
id, err := odb.Write([]byte("hello, world!"), ObjectBlob)
checkFatal(t, err)
expectedId, err := NewOid("30f51a3fba5274d53522d0f19748456974647b4f")
checkFatal(t, err)
if !expectedId.Equal(id) {
t.Errorf("mismatched id. expected %v, got %v", expectedId.String(), id.String())
}
// The object should be available from the odb.
{
obj, err := odb.Read(expectedId)
checkFatal(t, err)
defer obj.Free()
}
data, err := mempack.Dump(repo)
checkFatal(t, err)
expectedData := []byte{
0x50, 0x41, 0x43, 0x4b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
0x02, 0x9d, 0x08, 0x82, 0x3b, 0xd8, 0xa8, 0xea, 0xb5, 0x10, 0xad, 0x6a,
0xc7, 0x5c, 0x82, 0x3c, 0xfd, 0x3e, 0xd3, 0x1e,
}
if !bytes.Equal(expectedData, data) {
t.Errorf("mismatched mempack data. expected %v, got %v", expectedData, data)
}
mempack.Reset()
// After the reset, the object should now be unavailable.
{
obj, err := odb.Read(expectedId)
if err == nil {
t.Errorf("object %s unexpectedly found", obj.Id().String())
obj.Free()
} else if !IsErrorCode(err, ErrNotFound) {
t.Errorf("unexpected error %v", err)
}
}
}