diff options
| author | Austin Clements <austin@google.com> | 2015-12-13 17:08:01 -0500 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2015-12-14 15:07:39 +0000 |
| commit | d146d647cc992aabf3c7cabc6baf29040ed13e23 (patch) | |
| tree | 75375cf478986fc3259a65b29afbcef734931639 /git-codereview/pending_test.go | |
| parent | 143352e9df416ac808f2bb75e8fd1cea5a038c5d (diff) | |
| download | go-x-review-d146d647cc992aabf3c7cabc6baf29040ed13e23.tar.xz | |
git-codereview: fix branch "behind" count
git-codereview pending's count of how far behind a branch is is
currently wrong. It computes this from the length of the string
printed by git log --format=format:x, but forgets that git log
automatically adds new lines between each commit. As a result, given
that the true count is n, git pending prints 2n-1.
Fix this by counting the number of lines printed by git log, not the
number of characters.
Change-Id: I5702a833d34333099cad7d88c03837088ac4f9a8
Reviewed-on: https://go-review.googlesource.com/17771
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'git-codereview/pending_test.go')
| -rw-r--r-- | git-codereview/pending_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-codereview/pending_test.go b/git-codereview/pending_test.go index f43dd36..7f2d354 100644 --- a/git-codereview/pending_test.go +++ b/git-codereview/pending_test.go @@ -102,7 +102,7 @@ func TestPendingComplex(t *testing.T) { file file1 - work REVHASH..REVHASH (5 behind) + work REVHASH..REVHASH (3 behind) + REVHASH msg |
