Merge branch 'cb/log-follow-with-combined' into maint
"git log -c --follow $path" segfaulted upon hitting the commit that renamed the $path being followed. * cb/log-follow-with-combined: fix segfault with git log -c --follow
This commit is contained in:
commit
318e758f32
@ -1305,6 +1305,7 @@ void diff_tree_combined(const unsigned char *sha1,
|
|||||||
int i, num_paths, needsep, show_log_first, num_parent = parents->nr;
|
int i, num_paths, needsep, show_log_first, num_parent = parents->nr;
|
||||||
|
|
||||||
diffopts = *opt;
|
diffopts = *opt;
|
||||||
|
diff_tree_setup_paths(diffopts.pathspec.raw, &diffopts);
|
||||||
diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
|
diffopts.output_format = DIFF_FORMAT_NO_OUTPUT;
|
||||||
DIFF_OPT_SET(&diffopts, RECURSIVE);
|
DIFF_OPT_SET(&diffopts, RECURSIVE);
|
||||||
DIFF_OPT_CLR(&diffopts, ALLOW_EXTERNAL);
|
DIFF_OPT_CLR(&diffopts, ALLOW_EXTERNAL);
|
||||||
@ -1375,6 +1376,8 @@ void diff_tree_combined(const unsigned char *sha1,
|
|||||||
paths = paths->next;
|
paths = paths->next;
|
||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
diff_tree_release_paths(&diffopts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void diff_tree_combined_merge(const struct commit *commit, int dense,
|
void diff_tree_combined_merge(const struct commit *commit, int dense,
|
||||||
|
@ -530,6 +530,20 @@ test_expect_success 'show added path under "--follow -M"' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'git log -c --follow' '
|
||||||
|
test_create_repo follow-c &&
|
||||||
|
(
|
||||||
|
cd follow-c &&
|
||||||
|
test_commit initial file original &&
|
||||||
|
git rm file &&
|
||||||
|
test_commit rename file2 original &&
|
||||||
|
git reset --hard initial &&
|
||||||
|
test_commit modify file foo &&
|
||||||
|
git merge -m merge rename &&
|
||||||
|
git log -c --follow file2
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
cat >expect <<\EOF
|
cat >expect <<\EOF
|
||||||
* commit COMMIT_OBJECT_NAME
|
* commit COMMIT_OBJECT_NAME
|
||||||
|\ Merge: MERGE_PARENTS
|
|\ Merge: MERGE_PARENTS
|
||||||
|
Loading…
Reference in New Issue
Block a user