diff --git a/list.go b/list.go index 4b72419..e11d14d 100644 --- a/list.go +++ b/list.go @@ -73,7 +73,7 @@ func listIterateRefs(forPush bool) error { return errgo.Notef(err, "walk(%s) cat close failed", p) } sha1 := strings.TrimSpace(string(data)) - refName := strings.TrimPrefix(p, ipfsRepoPath) + refName := strings.TrimPrefix(p, ipfsRepoPath+"/") ref2hash[refName] = sha1 log.WithField("refMap", ref2hash).Debug("ref2hash map updated") } diff --git a/main.go b/main.go index b7caa9b..b37a6f6 100644 --- a/main.go +++ b/main.go @@ -41,7 +41,6 @@ import ( "github.com/cryptix/git-remote-ipfs/internal/path" - "github.com/cryptix/git-remote-ipfs/Godeps/_workspace/src/github.com/cryptix/go/debug" "github.com/cryptix/git-remote-ipfs/Godeps/_workspace/src/github.com/cryptix/go/logging" "github.com/cryptix/git-remote-ipfs/Godeps/_workspace/src/github.com/ipfs/go-ipfs-shell" "github.com/cryptix/git-remote-ipfs/Godeps/_workspace/src/gopkg.in/errgo.v1" @@ -127,9 +126,9 @@ func main() { // speakGit acts like a git-remote-helper // see this for more: https://www.kernel.org/pub/software/scm/git/docs/gitremote-helpers.html func speakGit(r io.Reader, w io.Writer) error { - debugLog := logging.Logger("git") - r = debug.NewReadLogrus(debugLog, r) - w = debug.NewWriteLogrus(debugLog, w) + //debugLog := logging.Logger("git") + //r = debug.NewReadLogrus(debugLog, r) + //w = debug.NewWriteLogrus(debugLog, w) scanner := bufio.NewScanner(r) for scanner.Scan() { text := scanner.Text() diff --git a/push.go b/push.go index da73395..78878a3 100644 --- a/push.go +++ b/push.go @@ -77,7 +77,7 @@ func push(src, dst string) error { } h, ok := ref2hash[dst] if !ok { - return errgo.Newf("writeRef: ref2hash entry missing: %s", dst) + return errgo.Newf("writeRef: ref2hash entry missing: %s %+v", dst, ref2hash) } isFF := gitIsAncestor(h, srcSha1) if isFF != nil && !force { diff --git a/push_test.go b/push_test.go index 8cbaa94..bd04d3f 100644 --- a/push_test.go +++ b/push_test.go @@ -121,7 +121,7 @@ func TestPush_twice(t *testing.T) { "hello.txt": "e2839ad2e47386d342038958fba941fc78e3780e", "notes": "32ed91604b272860ec911fc2bf4ae631b7900aa8", "newFile": "cc7aae22f2d4301b6006e5f26e28b63579b61072", - "2ndNewFile": "cc7aae22f2d4301b6006e5f26e28b63579b61072", + "2ndNewFile": "bacbe054a5fc6654bac497e36b474cd6839e3616", } rmDir(t, cloneAndCheckout(t, nextURL, expectedClone)) }