diff options
author | zeripath <art27@cantab.net> | 2019-01-18 00:01:04 +0000 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2019-01-17 19:01:04 -0500 |
commit | 07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8 (patch) | |
tree | 87ced90635366b09e7e5f2634acfe2cbec2bc9f6 /models/action.go | |
parent | 9edc829c1758b436f8f52ebe61479af087940d60 (diff) | |
download | gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.tar.gz gitea-07802a2bc503a8c13d50e7ef04a0e13ccf2a90f8.zip |
Refactor repo.isBare to repo.isEmpty #5629 (#5714)
* Refactor repo.isBare to repo.isEmpty #5629
Signed-off-by: Andrew Thornton <art27@cantab.net>
* Remove Sync call
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go index d917c37746..5dc0eb18e6 100644 --- a/models/action.go +++ b/models/action.go @@ -574,13 +574,13 @@ func CommitRepoAction(opts CommitRepoActionOptions) error { refName := git.RefEndName(opts.RefFullName) - // Change default branch and bare status only if pushed ref is non-empty branch. - if repo.IsBare && opts.NewCommitID != git.EmptySHA && strings.HasPrefix(opts.RefFullName, git.BranchPrefix) { + // Change default branch and empty status only if pushed ref is non-empty branch. + if repo.IsEmpty && opts.NewCommitID != git.EmptySHA && strings.HasPrefix(opts.RefFullName, git.BranchPrefix) { repo.DefaultBranch = refName - repo.IsBare = false + repo.IsEmpty = false } - // Change repository bare status and update last updated time. + // Change repository empty status and update last updated time. if err = UpdateRepository(repo, false); err != nil { return fmt.Errorf("UpdateRepository: %v", err) } |