Merge branch 'jc/diff-relative'
[gitweb.git] / revision.c
index d3e8658104b63886bbade78366466eb4828efc28..84fbdd3af47c40879874d50b173ac633d279d734 100644 (file)
@@ -738,6 +738,10 @@ void init_revisions(struct rev_info *revs, const char *prefix)
        revs->commit_format = CMIT_FMT_DEFAULT;
 
        diff_setup(&revs->diffopt);
+       if (prefix && !revs->diffopt.prefix) {
+               revs->diffopt.prefix = prefix;
+               revs->diffopt.prefix_length = strlen(prefix);
+       }
 }
 
 static void add_pending_commit_list(struct rev_info *revs,
@@ -942,6 +946,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
        int left = 1;
        int all_match = 0;
        int regflags = 0;
+       int fixed = 0;
 
        /* First, search for "--" */
        seen_dashdash = 0;
@@ -1238,6 +1243,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                                regflags |= REG_ICASE;
                                continue;
                        }
+                       if (!strcmp(arg, "--fixed-strings") ||
+                           !strcmp(arg, "-F")) {
+                               fixed = 1;
+                               continue;
+                       }
                        if (!strcmp(arg, "--all-match")) {
                                all_match = 1;
                                continue;
@@ -1293,8 +1303,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
                }
        }
 
-       if (revs->grep_filter)
+       if (revs->grep_filter) {
                revs->grep_filter->regflags |= regflags;
+               revs->grep_filter->fixed = fixed;
+       }
 
        if (show_merge)
                prepare_show_merge(revs);