-
-
Notifications
You must be signed in to change notification settings - Fork 616
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
Fix bug for running tasks twice #1804
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ type Task struct { | |||||||||
Watch bool | ||||||||||
Location *Location | ||||||||||
// Populated during merging | ||||||||||
Namespace string | ||||||||||
Namespace []string | ||||||||||
IncludeVars *Vars | ||||||||||
IncludedTaskfileVars *Vars | ||||||||||
} | ||||||||||
|
@@ -57,8 +57,10 @@ func (t *Task) Name() string { | |||||||||
|
||||||||||
func (t *Task) LocalName() string { | ||||||||||
name := t.Task | ||||||||||
name = strings.TrimPrefix(name, t.Namespace) | ||||||||||
name = strings.TrimPrefix(name, ":") | ||||||||||
for _, namespace := range t.Namespace { | ||||||||||
name = strings.TrimPrefix(name, namespace) | ||||||||||
name = strings.TrimPrefix(name, ":") | ||||||||||
} | ||||||||||
return name | ||||||||||
} | ||||||||||
|
||||||||||
|
@@ -219,7 +221,7 @@ func (t *Task) DeepCopy() *Task { | |||||||||
Platforms: deepcopy.Slice(t.Platforms), | ||||||||||
Location: t.Location.DeepCopy(), | ||||||||||
Requires: t.Requires.DeepCopy(), | ||||||||||
Namespace: t.Namespace, | ||||||||||
Namespace: append([]string{}, t.Namespace...), | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change isn't necessary.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But this is not an array, which would mean that a deep copy would need to deep copy the array too right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes sorry, you are right. We have
Suggested change
|
||||||||||
} | ||||||||||
return c | ||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think these are necessary. You can just call
buff.buf.Reset()
like you have done elsewhere. The only operation that needs a mutex isWrite()
.