Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kubo_final
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anastasiia Chirikova
kubo_final
Commits
a0aa07e3
Commit
a0aa07e3
authored
10 years ago
by
Jeromy Johnson
Browse files
Options
Downloads
Patches
Plain Diff
rename root to last
parent
38479ff1
Branches
Branches containing commit
No related tags found
1 merge request
!1
New
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
importer/helpers/dagbuilder.go
+4
-3
4 additions, 3 deletions
importer/helpers/dagbuilder.go
importer/importer.go
+3
-3
3 additions, 3 deletions
importer/importer.go
with
7 additions
and
6 deletions
importer/helpers/dagbuilder.go
+
4
−
3
View file @
a0aa07e3
...
...
@@ -6,9 +6,10 @@ import (
)
// NodeCB is callback function for dag generation
// the `root` flag signifies whether or not this is
// the root of a dag.
type
NodeCB
func
(
node
*
dag
.
Node
,
root
bool
)
error
// the `last` flag signifies whether or not this is the last
// (top-most root) node being added. useful for things like
// only pinning the first node recursively.
type
NodeCB
func
(
node
*
dag
.
Node
,
last
bool
)
error
var
nilFunc
NodeCB
=
func
(
_
*
dag
.
Node
,
_
bool
)
error
{
return
nil
}
...
...
This diff is collapsed.
Click to expand it.
importer/importer.go
+
3
−
3
View file @
a0aa07e3
...
...
@@ -66,13 +66,13 @@ func BuildTrickleDagFromReader(r io.Reader, ds dag.DAGService, spl chunk.BlockSp
}
func
BasicPinnerCB
(
p
pin
.
ManualPinner
)
h
.
NodeCB
{
return
func
(
n
*
dag
.
Node
,
roo
t
bool
)
error
{
return
func
(
n
*
dag
.
Node
,
las
t
bool
)
error
{
k
,
err
:=
n
.
Key
()
if
err
!=
nil
{
return
err
}
if
roo
t
{
if
las
t
{
p
.
PinWithMode
(
k
,
pin
.
Recursive
)
return
p
.
Flush
()
}
else
{
...
...
@@ -83,7 +83,7 @@ func BasicPinnerCB(p pin.ManualPinner) h.NodeCB {
}
func
PinIndirectCB
(
p
pin
.
ManualPinner
)
h
.
NodeCB
{
return
func
(
n
*
dag
.
Node
,
roo
t
bool
)
error
{
return
func
(
n
*
dag
.
Node
,
las
t
bool
)
error
{
k
,
err
:=
n
.
Key
()
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment