Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/kubo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a5521fcc765f^
Choose a base ref
...
head repository: ipfs/kubo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 490ed41c4541
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Jul 28, 2015

  1. sharness/repo: fix pinning test

    looks like the test was broken by GC-ing everything.
    the pin expects $HASH to still be there.
    
    License: MIT
    Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
    jbenet committed Jul 28, 2015
    Copy the full SHA
    a5521fc View commit details
  2. Fix refs -r -u for #1211

    License: MIT
    Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
    gatesvp authored and jbenet committed Jul 28, 2015
    2
    Copy the full SHA
    8fe7d2f View commit details
  3. sharness/ipfs refs bigger tests

    License: MIT
    Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
    jbenet committed Jul 28, 2015
    Copy the full SHA
    490ed41 View commit details
Showing with 48 additions and 4 deletions.
  1. +0 −4 core/commands/refs.go
  2. +48 −0 test/sharness/t0080-repo.sh
4 changes: 0 additions & 4 deletions core/commands/refs.go
Original file line number Diff line number Diff line change
@@ -232,10 +232,6 @@ func (rw *RefWriter) writeRefsRecursive(n *dag.Node) (int, error) {
return 0, err
}

if rw.skip(nkey) {
return 0, nil
}

var count int
for i, ng := range rw.DAG.GetDAG(rw.Ctx, n) {
lk := key.Key(n.Links[i].Hash)
48 changes: 48 additions & 0 deletions test/sharness/t0080-repo.sh
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ test_expect_success "file no longer pinned" '
'

test_expect_success "recursively pin afile" '
HASH=`ipfs add -q afile` &&
ipfs pin add -r "$HASH"
'

@@ -162,6 +163,53 @@ test_expect_success "'ipfs pin ls --type=all --quiet' is correct" '
test_sort_cmp allpins_uniq_hashes actual_allpins
'

test_expect_success "'ipfs refs --unique' is correct" '
mkdir -p uniques &&
cd uniques &&
echo "content1" > file1 &&
echo "content1" > file2 &&
ROOT=$(ipfs add -r -q . | tail -n1) &&
ipfs refs --unique $ROOT >expected &&
ipfs add -q file1 >unique_hash &&
test_cmp expected unique_hash
'

test_expect_success "'ipfs refs --unique --recursive' is correct" '
mkdir -p a/b/c &&
echo "c1" > a/f1 &&
echo "c1" > a/b/f1 &&
echo "c1" > a/b/c/f1 &&
echo "c2" > a/b/c/f2 &&
ROOT=$(ipfs add -r -q a | tail -n1) &&
ipfs refs --unique --recursive $ROOT >refs_output &&
wc -l refs_output | sed "s/^ *//g" >line_count &&
echo "4 refs_output" >expected &&
test_cmp expected line_count
'

test_expect_success "'ipfs refs --recursive (bigger)'" '
mkdir -p b/c/d/e &&
echo "content1" >b/f &&
echo "content1" >b/c/f1 &&
echo "content1" >b/c/d/f2 &&
echo "content2" >b/c/f2 &&
echo "content2" >b/c/d/f1 &&
echo "content2" >b/c/d/e/f &&
cp -r b b2 && mv b2 b/b2 &&
cp -r b b3 && mv b3 b/b3 &&
cp -r b b4 && mv b4 b/b4 &&
hash=$(ipfs add -r -q b | tail -n1) &&
ipfs refs -r "$hash" | wc -l | sed "s/^ *//g" >actual &&
echo "79" >expected &&
test_cmp expected actual
'

test_expect_success "'ipfs refs --unique --recursive (bigger)'" '
ipfs refs -r "$hash" | sort | uniq >expected &&
ipfs refs -r -u "$hash" | sort >actual &&
test_cmp expected actual
'

test_kill_ipfs_daemon

test_done