aboutsummaryrefslogtreecommitdiff
path: root/modules/git
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/commit.go4
-rw-r--r--modules/git/submodule.go4
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/git/commit.go b/modules/git/commit.go
index d2d373da..4e254dce 100644
--- a/modules/git/commit.go
+++ b/modules/git/commit.go
@@ -88,11 +88,11 @@ func (c *Commit) GetCommitOfRelPath(relPath string) (*Commit, error) {
}
func (c *Commit) GetSubModule(entryname string) (*SubModule, error) {
- moduels, err := c.GetSubModules()
+ modules, err := c.GetSubModules()
if err != nil {
return nil, err
}
- return moduels[entryname], nil
+ return modules[entryname], nil
}
func (c *Commit) GetSubModules() (map[string]*SubModule, error) {
diff --git a/modules/git/submodule.go b/modules/git/submodule.go
index 6927f8cb..0c7c2696 100644
--- a/modules/git/submodule.go
+++ b/modules/git/submodule.go
@@ -31,6 +31,10 @@ func NewSubModuleFile(c *Commit, refUrl, refId string) *SubModuleFile {
// RefUrl guesses and returns reference URL.
func (sf *SubModuleFile) RefUrl() string {
+ if sf.refUrl == "" {
+ return ""
+ }
+
url := strings.TrimSuffix(sf.refUrl, ".git")
// git://xxx/user/repo