Esempio n. 1
0
        // GET: GitSetup/Details/5
        public ActionResult Details(int id)
        {
            var model          = db.GitSetup.FirstOrDefault(i => i.Id == id);
            var gitSharpClient = new GitSharpClient(model.RepositoryPath);

            ViewBag.CurrentBranch = gitSharpClient.CurrentBranch().FriendlyName;
            ViewBag.LastTag       = gitSharpClient.LastTag();
            ViewBag.LastModify    = gitSharpClient.LastModify();
            ViewBag.Status        = gitSharpClient.Status();

            return(Edit(id));
        }
Esempio n. 2
0
        private void InsertGitPanel(ref string htmlPanel, int projectId)
        {
            var gitList = db.GitSetup.Where(g => g.ProjectId == projectId);

            foreach (var gitSetup in gitList)
            {
                var gitClient = new GitSharpClient(gitSetup.RepositoryPath);
                var template  = string.Format(PanelDashboardTemplate(), "<img src='../../Images/logoGIT.png' width=45px height:35px></img>",
                                              "<h5 style='word-wrap: break-word'><b>To clone:</b> " + gitSetup.Description + "</h5>" +
                                              "<h5 style='word-wrap: break-word'><b>Last modify:</b> " + gitClient.LastModify() + "</h5>");
                htmlPanel += template;
            }
        }
Esempio n. 3
0
        public ActionResult Pull(int id)
        {
            try
            {
                var    model      = db.GitSetup.FirstOrDefault(i => i.Id == id);
                string credential = new Crypt32().Decrypt(model.Crendential);
                var    status     = new GitSharpClient(model.RepositoryPath).Pull(credential.Split('|')[0], credential.Split('|')[1]);
                TempData["Success"] = "Git pull command process with success. " + status;
            }
            catch (Exception e)
            {
                TempData["ErrorMessage"] = e.Message;
            }

            return(Redirect(Request.UrlReferrer.PathAndQuery));
        }