File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ func CommitRepoAction(opts CommitRepoActionOptions) error {
517
517
}
518
518
519
519
// Change repository bare status and update last updated time.
520
- repo .IsBare = false
520
+ repo .IsBare = repo . IsBare && opts . Commits . Len <= 0
521
521
if err = UpdateRepository (repo , false ); err != nil {
522
522
return fmt .Errorf ("UpdateRepository: %v" , err )
523
523
}
Original file line number Diff line number Diff line change @@ -392,6 +392,10 @@ func RepoRef() macaron.Handler {
392
392
if err != nil {
393
393
ctx .Handle (500 , "GetBranches" , err )
394
394
return
395
+ } else if len (brs ) == 0 {
396
+ err = fmt .Errorf ("No branches in non-bare repository %s" ,
397
+ ctx .Repo .GitRepo .Path )
398
+ ctx .Handle (500 , "GetBranches" , err )
395
399
}
396
400
refName = brs [0 ]
397
401
}
You can’t perform that action at this time.
0 commit comments