Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(ipld-prime) Use mh.Set() for "hash" -> mhType & Make git plugin test work again #8287

Merged
merged 6 commits into from
Jul 23, 2021

Conversation

rvagg
Copy link
Member

@rvagg rvagg commented Jul 21, 2021

@mvdan this extends your last commit to the branch to do mh.Set() for hash as well.

It also revives t0280 for the git-plugin. The diff with master is the most interesting bit now:

diff --git a/test/sharness/t0280-plugin-git.sh b/test/sharness/t0280-plugin-git.sh
index e7bc06427..d90df46bc 100755
--- a/test/sharness/t0280-plugin-git.sh
+++ b/test/sharness/t0280-plugin-git.sh
@@ -17,7 +17,7 @@ test_expect_success "prepare test data" '

 test_dag_git() {
   test_expect_success "add objects via dag put" '
-    find objects -type f -exec ipfs dag put --format=git --input-enc=zlib {} \; -exec echo \; > hashes
+    find objects -type f -exec ipfs dag put --format=git-raw --input-enc=3145848 --hash=sha1 {} \; -exec echo -n \; > hashes
   '

   test_expect_success "successfully get added objects" '
@@ -25,8 +25,8 @@ test_dag_git() {
   '

   test_expect_success "path traversals work" '
-    echo \"YmxvYiA3ACcsLnB5Zgo=\" > file1 &&
-    ipfs dag get baf4bcfhzi72pcj5cc4ocz7igcduubuu7aa3cddi/object/parents/0/tree/dir2/hash/f3/hash > out1
+    echo -n "{\"/\":{\"bytes\":\"YmxvYiA3ACcsLnB5Zgo=\"}}" > file1 &&
+    ipfs dag get baf4bcfhzi72pcj5cc4ocz7igcduubuu7aa3cddi/Object/Parents/0/GitTree/1/Hash/0/Hash > out1
   '

   test_expect_success "outputs look correct" '

Note the pathing through the git object at the bottom there. I wouldn't mind getting that addressed - don't CamelCase, at least one rename, and maybe turn those arrays into maps so we can do it by name. It'd be nice to maintain consistency of forms.

@rvagg
Copy link
Member Author

rvagg commented Jul 21, 2021

Noice, Circle giving green now for sharness

core/commands/dag/dag.go Show resolved Hide resolved
plugin/plugins/git/git.go Outdated Show resolved Hide resolved
test/sharness/t0280-plugin-git.sh Outdated Show resolved Hide resolved
test/sharness/t0280-plugin-git.sh Outdated Show resolved Hide resolved
@rvagg rvagg force-pushed the rvagg/feat/dag-put-ipld-prime branch from fdc7245 to 07c3b2b Compare July 23, 2021 10:08
@rvagg rvagg merged commit 42155c4 into feat/dag-put-ipld-prime Jul 23, 2021
@rvagg rvagg deleted the rvagg/feat/dag-put-ipld-prime branch July 23, 2021 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants