- else if (!p->two->file_valid) {
- if (contains(p->one, needle, len))
- diff_queue(&outq, p->one, p->two);
+ regexp = ®ex;
+ }
+
+ if (opts & DIFF_PICKAXE_ALL) {
+ /* Showing the whole changeset if needle exists */
+ for (i = has_changes = 0; !has_changes && i < q->nr; i++) {
+ struct diff_filepair *p = q->queue[i];
+ if (!DIFF_FILE_VALID(p->one)) {
+ if (!DIFF_FILE_VALID(p->two))
+ continue; /* ignore unmerged */
+ /* created */
+ if (contains(p->two, needle, len, regexp))
+ has_changes++;
+ }
+ else if (!DIFF_FILE_VALID(p->two)) {
+ if (contains(p->one, needle, len, regexp))
+ has_changes++;
+ }
+ else if (!diff_unmodified_pair(p) &&
+ contains(p->one, needle, len, regexp) !=
+ contains(p->two, needle, len, regexp))
+ has_changes++;