Skip to content

Commit

Permalink
Don't display diff against master on /status/, link to /diff/.
Browse files Browse the repository at this point in the history
It's more readable in /diff/ view, no point in having the exact same
thing in both places.
  • Loading branch information
dmitshur committed Sep 18, 2016
1 parent 3f484d7 commit a0fafec
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6569,17 +6569,11 @@ func initHttpHandlers() {
}

// git diff against master.
b += "\n" + underline("git diff against master")
if workingDiffMaster := u6.GoPackageWorkingDiffMaster(goPackage); workingDiffMaster != "" {
b += "\n" + underline("git diff against master")

// Stats (lines added/removed).
cmd := exec.Command("git", "diff", "--stat", "--find-renames", "master")
cmd.Dir = goPackage.Dir.Repo.Vcs.RootPath()
if stat, err := cmd.CombinedOutput(); err == nil {
b += "\n```\n" + trim.LastNewline(string(stat)) + "\n```\n"
}

b += "\n```diff\n" + workingDiffMaster + "\n```\n"
b += "\nView diff [here](/diff/" + importPath + ").\n"
} else {
b += "\n_(No diff.)_\n"
}
}
} else {
Expand Down

0 comments on commit a0fafec

Please sign in to comment.