Skip to content

Commit

Permalink
diff-format.txt: dst can be 0* SHA-1 when path is deleted, too
Browse files Browse the repository at this point in the history
"dst" can legitimately be "0\{40\}" for a creation patch, e.g. when
the stat information is stale, but it falls into "look at work tree"
case.  The original description in b6d8f30 ([PATCH] diff-raw format
update take microsoft#2., 2005-05-23) forgot that deletion also makes the
"dst" 0* SHA-1.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
phil-blain authored and gitster committed Jun 13, 2022
1 parent dc8c8de commit 7922a17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/diff-format.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ That is, from the left to the right:
. a space.
. sha1 for "src"; 0\{40\} if creation or unmerged.
. a space.
. sha1 for "dst"; 0\{40\} if creation, unmerged or "look at work tree".
. sha1 for "dst"; 0\{40\} if deletion, unmerged or "look at work tree".
. a space.
. status, followed by optional "score" number.
. a tab or a NUL when `-z` option is used.
Expand Down

0 comments on commit 7922a17

Please sign in to comment.