Re: is this a bug of git-diff?
From: Antoine Pelisse <hidden>
Date: 2016-06-15 22:57:15
On Wed, May 15, 2013 at 8:52 AM, eric liou [off-list ref] wrote:
Thank you for the quick reply. But this line is not correct: "@@ -4,5 +4,6 @@ int a = 1;"
Oh OK, I see. Git tries to name the function where the changes take place. This is purely informative. In your example, you don't have any function so of course the information is not very helpful. Typically it will look like the following, helping the reader by giving the function name:
@@ -591,6 +609,14 @@ int cmd_grep(int argc, const char **argv, constchar *prefix)
paths[1] = NULL;
}
+ if (!use_index) {
+ if (cached)
+ die("--cached cannot be used with --no-index.");
+ if (list.nr)
+ die("--no-index cannot be used with revs.");
+ return !grep_directory(&opt, paths);
+ }
+
if (!list.nr) {
if (!cached)
setup_work_tree();