grim/hgkeeper

Refresh auth when hg init is called

2020-01-31, Gary Kramlich
e82a54e2ca41
Parents 20da8ebdfc2f
Children 9f746cdbf79b
Refresh auth when hg init is called
--- a/ssh/commands/init.go Wed Dec 18 00:46:05 2019 -0600
+++ b/ssh/commands/init.go Fri Jan 31 09:19:57 2020 -0600
@@ -5,6 +5,7 @@
"path/filepath"
"github.com/gliderlabs/ssh"
+ log "github.com/sirupsen/logrus"
"bitbucket.org/rw_grim/hgkeeper/access"
"bitbucket.org/rw_grim/hgkeeper/hg"
@@ -27,5 +28,11 @@
return fmt.Errorf("access denied")
}
- return run(hg.Init(i.repoPath), session)
+ if err := run(hg.Init(i.repoPath), session); err != nil {
+ return err
+ }
+
+ log.Info("refreshing access control for new repo")
+
+ return access.Refresh()
}