From e3a390096c57246d39889a5bdc1a7daf98868c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=A5=95=E6=96=90?= Date: Tue, 17 Apr 2018 11:57:25 +0800 Subject: [PATCH 1/7] add the Owner Name to differentiate when merging --- routers/repo/pull.go | 2 ++ templates/repo/pulls/compare.tmpl | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index a852cee1f..f21d8ac7e 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -615,8 +615,10 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, * if isSameRepo { headRepo = ctx.Repo.Repository headGitRepo = ctx.Repo.GitRepo + c.Data["BaseName"] = headRepo.Owner.Name } else { headGitRepo, err = git.OpenRepository(models.RepoPath(headUser.Name, headRepo.Name)) + c.Data["BaseName"] = headRepo.BaseRepo.Owner.Name if err != nil { ctx.ServerError("OpenRepository", err) return nil, nil, nil, nil, "", "" diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index 5b71fa521..d2e00ace3 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -11,7 +11,7 @@ @@ -29,7 +29,7 @@ ... From 74df8a0fa49fe5c087d1b50e7835b2e72eb7725f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=A5=95=E6=96=90?= Date: Tue, 17 Apr 2018 12:04:44 +0800 Subject: [PATCH 2/7] add the Owner Name to differentiate when merging --- templates/repo/pulls/compare.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index d2e00ace3..a9ea742f0 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -44,7 +44,7 @@ - + {{if .IsNothingToCompare}}
From 7463f9d9c923aeac3bdab47304e7c333ba522f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=A5=95=E6=96=90?= Date: Tue, 17 Apr 2018 12:05:13 +0800 Subject: [PATCH 3/7] add the Owner Name to differentiate when merging --- templates/repo/pulls/compare.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index a9ea742f0..f0333e754 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -40,7 +40,7 @@
From 603f120215d15548d3951e5d2dfcac5380d7db47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=A5=95=E6=96=90?= Date: Tue, 17 Apr 2018 12:15:13 +0800 Subject: [PATCH 4/7] add the Owner Name to differentiate when merging --- templates/repo/pulls/compare.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index f0333e754..896839e2c 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -47,7 +47,7 @@ {{if .IsNothingToCompare}} -
+
{{.i18n.Tr "repo.pulls.nothing_to_compare"}}
{{else if .HasPullRequest}} From be6bb84289d91ebcb42c51df3828b49d5621e30a Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sun, 6 May 2018 11:59:07 +0300 Subject: [PATCH 5/7] Remove unnecessary spaces --- templates/repo/pulls/compare.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index 896839e2c..a9ea742f0 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -40,14 +40,14 @@
{{if .IsNothingToCompare}} -
+
{{.i18n.Tr "repo.pulls.nothing_to_compare"}}
{{else if .HasPullRequest}} From ebe42e58372b0b24e302e6153e55c65f4532848d Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sun, 6 May 2018 12:00:05 +0300 Subject: [PATCH 6/7] Remove one more unnecessary space --- templates/repo/pulls/compare.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/pulls/compare.tmpl b/templates/repo/pulls/compare.tmpl index a9ea742f0..d2e00ace3 100644 --- a/templates/repo/pulls/compare.tmpl +++ b/templates/repo/pulls/compare.tmpl @@ -44,7 +44,7 @@
- + {{if .IsNothingToCompare}}
From 6c9d94e05ab8c6405adcf329cea7df369b55b199 Mon Sep 17 00:00:00 2001 From: Lauris BH Date: Sun, 6 May 2018 12:04:50 +0300 Subject: [PATCH 7/7] Fix to corrext context variable name --- routers/repo/pull.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index f21d8ac7e..416e32eb0 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -615,10 +615,10 @@ func ParseCompareInfo(ctx *context.Context) (*models.User, *models.Repository, * if isSameRepo { headRepo = ctx.Repo.Repository headGitRepo = ctx.Repo.GitRepo - c.Data["BaseName"] = headRepo.Owner.Name + ctx.Data["BaseName"] = headRepo.Owner.Name } else { headGitRepo, err = git.OpenRepository(models.RepoPath(headUser.Name, headRepo.Name)) - c.Data["BaseName"] = headRepo.BaseRepo.Owner.Name + ctx.Data["BaseName"] = headRepo.BaseRepo.Owner.Name if err != nil { ctx.ServerError("OpenRepository", err) return nil, nil, nil, nil, "", ""