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

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--line-log.c1
-rwxr-xr-xt/t4211-line-log.sh2
2 files changed, 2 insertions, 1 deletions
diff --git a/line-log.c b/line-log.c
index 6f94d56063..c2d01dccc2 100644
--- a/line-log.c
+++ b/line-log.c
@@ -299,6 +299,7 @@ static void line_log_data_insert(struct line_log_data **list,
p = xcalloc(1, sizeof(struct line_log_data));
p->path = path;
range_set_append(&p->ranges, begin, end);
+ sort_and_merge_range_set(&p->ranges);
if (ip) {
p->next = ip->next;
ip->next = p;
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index e7a6e49965..00a850d611 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -73,7 +73,7 @@ test_expect_success '-L {empty-range} (any -L)' '
git log -L1,1:b.c -L$n:b.c
'
-test_expect_failure '-L {empty-range} (first -L)' '
+test_expect_success '-L {empty-range} (first -L)' '
n=$(expr $(wc -l <b.c) + 1) &&
git log -L$n:b.c
'