aboutsummaryrefslogtreecommitdiffstats
path: root/modules/pull
diff options
context:
space:
mode:
authorMura Li <typeless@users.noreply.github.com>2019-09-03 20:42:01 +0800
committerLauris BH <lauris@nix.lv>2019-09-03 15:42:01 +0300
commitc027eac1d6a4ec24bb28fc53d8f3e82404cada0d (patch)
tree09e2f26f80b4ee4b9ac7bc7a805cb125c723973d /modules/pull
parent6ed22ffd16b80348d52daa0e1915608d307bfe87 (diff)
downloadgitea-c027eac1d6a4ec24bb28fc53d8f3e82404cada0d.tar.gz
gitea-c027eac1d6a4ec24bb28fc53d8f3e82404cada0d.zip
Avoid ambiguity of branch/directory names for the git-diff-tree command (#8066)
Diffstat (limited to 'modules/pull')
-rw-r--r--modules/pull/merge.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/pull/merge.go b/modules/pull/merge.go
index ef154128c7..89f3e9fd2c 100644
--- a/modules/pull/merge.go
+++ b/modules/pull/merge.go
@@ -299,8 +299,7 @@ func getDiffTree(repoPath, baseBranch, headBranch string) (string, error) {
getDiffTreeFromBranch := func(repoPath, baseBranch, headBranch string) (string, error) {
var outbuf, errbuf strings.Builder
// Compute the diff-tree for sparse-checkout
- // The branch argument must be enclosed with double-quotes ("") in case it contains slashes (e.g "feature/test")
- if err := git.NewCommand("diff-tree", "--no-commit-id", "--name-only", "-r", "--root", baseBranch, headBranch).RunInDirPipeline(repoPath, &outbuf, &errbuf); err != nil {
+ if err := git.NewCommand("diff-tree", "--no-commit-id", "--name-only", "-r", "--root", baseBranch, headBranch, "--").RunInDirPipeline(repoPath, &outbuf, &errbuf); err != nil {
return "", fmt.Errorf("git diff-tree [%s base:%s head:%s]: %s", repoPath, baseBranch, headBranch, errbuf.String())
}
return outbuf.String(), nil