Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-03 01:30:41 +0300
committerJunio C Hamano <gitster@pobox.com>2018-08-03 01:30:41 +0300
commit6566a917d8a8d3070b5fdc94fbe5f6d68a4d656b (patch)
tree5a8ac927a48d840786c5cca578221008f2baf9d1 /builtin/blame.c
parentaf8ac73801eebf0f3690c3875751eb9e108ceda8 (diff)
parent7f81c00f3b1bd45c2954b18550b8e351651f72f3 (diff)
Merge branch 'is/parsing-line-range'
Parsing of -L[<N>][,[<M>]] parameters "git blame" and "git log" take has been tweaked. * is/parsing-line-range: log: prevent error if line range ends past end of file blame: prevent error if range ends past end of file
Diffstat (limited to 'builtin/blame.c')
-rw-r--r--builtin/blame.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 468b17c30c3..5c93d169dd4 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1002,13 +1002,13 @@ parse_done:
nth_line_cb, &sb, lno, anchor,
&bottom, &top, sb.path))
usage(blame_usage);
- if (lno < top || ((lno || bottom) && lno < bottom))
+ if ((!lno && (top || bottom)) || lno < bottom)
die(Q_("file %s has only %lu line",
"file %s has only %lu lines",
lno), path, lno);
if (bottom < 1)
bottom = 1;
- if (top < 1)
+ if (top < 1 || lno < top)
top = lno;
bottom--;
range_set_append_unsafe(&ranges, bottom, top);