diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2016-10-24 12:42:19 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-24 19:47:28 +0200 |
commit | 425a28e0a4edfc39585cec6b0b6368c0ad9dbf7e (patch) | |
tree | 453a583c0e244d2edb0f729f831e5d7c76f5894c /t/t7064-wtstatus-pv2.sh | |
parent | Fifth batch for 2.11 (diff) | |
download | git-425a28e0a4edfc39585cec6b0b6368c0ad9dbf7e.tar.xz git-425a28e0a4edfc39585cec6b0b6368c0ad9dbf7e.zip |
diff-lib: allow ita entries treated as "not yet exist in index"
When comparing the index and the working tree to show which paths are
new, and comparing the tree recorded in the HEAD and the index to see if
committing the contents recorded in the index would result in an empty
commit, we would want the former comparison to say "these are new paths"
and the latter to say "there is no change" for paths that are marked as
intent-to-add.
We made a similar attempt at d95d728a ("diff-lib.c: adjust position of
i-t-a entries in diff", 2015-03-16), which redefined the semantics of
these two comparison modes globally, which was a disaster and had to be
reverted at 78cc1a54 ("Revert "diff-lib.c: adjust position of i-t-a
entries in diff"", 2015-06-23).
To make sure we do not repeat the same mistake, introduce a new internal
diffopt option so that this different semantics can be asked for only by
callers that ask it, while making sure other unaudited callers will get
the same comparison result.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7064-wtstatus-pv2.sh')
-rwxr-xr-x | t/t7064-wtstatus-pv2.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t7064-wtstatus-pv2.sh b/t/t7064-wtstatus-pv2.sh index 3012a4d7c0..e319fa2e84 100755 --- a/t/t7064-wtstatus-pv2.sh +++ b/t/t7064-wtstatus-pv2.sh @@ -246,8 +246,8 @@ test_expect_success 'verify --intent-to-add output' ' git add --intent-to-add intent1.add intent2.add && cat >expect <<-EOF && - 1 AM N... 000000 100644 100644 $_z40 $EMPTY_BLOB intent1.add - 1 AM N... 000000 100644 100644 $_z40 $EMPTY_BLOB intent2.add + 1 .A N... 000000 000000 100644 $_z40 $_z40 intent1.add + 1 .A N... 000000 000000 100644 $_z40 $_z40 intent2.add EOF git status --porcelain=v2 >actual && |