Fix Issue 589

Fixed issue https://github.com/gogits/gogs/issues/589