}
if len(c.Args()) < 1 {
- fail("Not enough arguments", "Not enough arugments")
+ fail("Not enough arguments", "Not enough arguments")
}
keys := strings.Split(c.Args()[0], "-")
user, err := models.GetUserByKeyId(keyId)
if err != nil {
- fail("internal error", "Fail to get user by key ID(%d): %v", keyId, err)
+ fail("internal error", "Failed to get user by key ID(%d): %v", keyId, err)
}
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
repoPath := strings.Trim(args, "'")
rr := strings.SplitN(repoPath, "/", 2)
if len(rr) != 2 {
- fail("Invalid repository path", "Invalide repository path: %v", args)
+ fail("Invalid repository path", "Invalid repository path: %v", args)
}
repoUserName := rr[0]
repoName := strings.TrimSuffix(rr[1], ".git")
if err == models.ErrUserNotExist {
fail("Repository owner does not exist", "Unregistered owner: %s", repoUserName)
}
- fail("Internal error", "Fail to get repository owner(%s): %v", repoUserName, err)
+ fail("Internal error", "Failed to get repository owner(%s): %v", repoUserName, err)
}
repo, err := models.GetRepositoryByName(repoUser.Id, repoName)
fail(_ACCESS_DENIED_MESSAGE, "Repository does not exist: %s/%s", repoUser.Name, repoName)
}
}
- fail("Internal error", "Fail to get repository: %v", err)
+ fail("Internal error", "Failed to get repository: %v", err)
}
requestedMode, has := COMMANDS[verb]
gitcmd.Stdin = os.Stdin
gitcmd.Stderr = os.Stderr
if err = gitcmd.Run(); err != nil {
- fail("Internal error", "Fail to execute git command: %v", err)
+ fail("Internal error", "Failed to execute git command: %v", err)
}
if requestedMode == models.ACCESS_MODE_WRITE {
err = models.Update(task.RefName, task.OldCommitId, task.NewCommitId,
user.Name, repoUserName, repoName, user.Id)
if err != nil {
- log.GitLogger.Error(2, "Fail to update: %v", err)
+ log.GitLogger.Error(2, "Failed to update: %v", err)
}
}