Commit 2ef0690
committed
fix(gh): skip compact_diff for --name-only/--stat flags in pr diff
When `gh pr diff` is called with output-format-changing flags like
--name-only, --stat, --name-status, --numstat, or --shortstat, the
output is a plain filename/stat list rather than a unified diff.
compact_diff() expects diff headers and hunks, so it produces empty
output from these formats.
Skip filtering and passthrough directly when any of these flags are
present. The output is already compact and doesn't benefit from diff
compaction.
Fixes #730
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>1 parent 4b52bfe commit 2ef0690
1 file changed
Lines changed: 55 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1118 | 1118 | | |
1119 | 1119 | | |
1120 | 1120 | | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1121 | 1133 | | |
1122 | 1134 | | |
1123 | 1135 | | |
| |||
1127 | 1139 | | |
1128 | 1140 | | |
1129 | 1141 | | |
1130 | | - | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
1131 | 1145 | | |
1132 | 1146 | | |
1133 | 1147 | | |
| |||
1538 | 1552 | | |
1539 | 1553 | | |
1540 | 1554 | | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
1541 | 1595 | | |
1542 | 1596 | | |
1543 | 1597 | | |
| |||
0 commit comments