-
-
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
Monitor all git commands; move blame to git package and replace git as a variable #6864
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6864 +/- ##
==========================================
+ Coverage 41.23% 41.24% +<.01%
==========================================
Files 464 464
Lines 62832 62841 +9
==========================================
+ Hits 25909 25916 +7
- Misses 33531 33536 +5
+ Partials 3392 3389 -3
Continue to review full report at Codecov.
|
Unit test for TestRepoIsEmpty fails in drone |
if err != nil { | ||
if strings.Contains(stderr, "fatal: bad default revision 'HEAD'") { |
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.
This change seems to change how this function works. This will always error without setting the repo.IsEmpty previously to return. Is it intended because it fix an issue ? In place, of starting another cli command inside gitRepo.IsEmpty() couldn't we use a method IsEmptyRepoErr(err) parsing the error of OpenRepository ?
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 run make unit-test
locally successfully but don't know why it failed on drone. I move these codes to git
package so that external shouldn't know how it works.
db5a963
to
e73f303
Compare
We should probably also set |
19a9117
to
08a22c2
Compare
…s a variable (go-gitea#6864) * monitor all git commands; move blame to git package and replace git as a variable * use git command but not other commands * fix build * move exec.Command to git.NewCommand * fix fmt * remove unrelated changes * remove unrelated changes * refactor IsEmpty and add tests * fix tests * fix tests * fix tests * fix tests * remove gitLogger * fix fmt * fix isEmpty * fix lint * fix tests
This PR did some changes:
command.Run
in git package so that all git processes will be monitored from admin panel. All these git processes haven't been monitored before."git"
asgit.GitExecutable
variable. will replace Support git.PATH entry in app.ini #6772.IsEmpty
forgit.Repository
with tests.git
.