git ssb

30+

cel / git-ssb-web



Commit 2989c2f89ee6bdf43744b5a88ca904afd86b92a3

Fix handling empty repos

Charles Lehner committed on 3/31/2016, 2:17:28 PM
Parent: a96c983b19a7f8943a1cf0d35d09ababdccb5f2d

Files changed

index.jschanged
index.jsView
@@ -834,12 +834,15 @@
834834 // get branch
835835 return path[1] ?
836836 serveRepoPage2(req, repo, path) :
837837 readNext(function (cb) {
838- repo.getSymRef('HEAD', true, function (err, value) {
838+ // TODO: handle this in pull-git-repo or ssb-git-repo
839+ repo.getSymRef('HEAD', true, function (err, ref) {
839840 if (err) return cb(err)
840- path[1] = value || null
841- cb(null, serveRepoPage2(req, repo, path))
841+ repo.resolveRef(ref, function (err, rev) {
842+ path[1] = rev ? ref : null
843+ cb(null, serveRepoPage2(req, repo, path))
844+ })
842845 })
843846 })
844847 }
845848

Built with git-ssb-web