-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Replace RunInDir with RunWithContext #18978
Replace RunInDir with RunWithContext #18978
Conversation
@martinscholz83 please run |
I think |
That |
I don't think so. |
I don't understand why it fails for arm64. |
One more thing for my understanding. I found a lot places like this where still the ctx error is logged instead of the output from |
@martinscholz83 a general roule: if err is just needed to check if it fails we dont need the stderr, if it is used in logs etc .. stderr is needed and I agree to add a wrapper called I'll have a look at this pull soon^TM |
Hmm... although this fails in different places each time I think it's been consistently failing too many times and we need to double check that there isn't a real issue here. |
# Conflicts: # services/mirror/mirror_pull.go # services/mirror/mirror_push.go
404785a
to
a6760a7
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This PR does wrong from begnning ..... replacing If there is a chance, the refactoring should use |
241d7bf
to
c3521dc
Compare
I reset the branch to the original one (cleaned my changes). I think we need to make some decisions about how to continue ...... |
// RunInDir executes the command in given directory | ||
// and returns stdout in string and error (combined with stderr). | ||
func (c *Command) RunInDir(dir string) (string, error) { |
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.
The key point is here, it returns "stdout in string and error (combined with stderr)"
So the RunInXxx
can not be replaced by RunWithContext
directly
Hi @martinscholz83 , thank you for your contribution and give us the hint about the refactoring. Now we can close #18553 and we have a clear git command module in Gitea! 🎉 Although this PR is not merged, it really help us to know how to continue about the refactoring. Appreciate your work. Now we can safely close this PR. |
Replace
RunInDir
withRunWIthContext
.#18553