Skip to content

Commit 160df71

Browse files
chriscoolgitster
authored andcommitted
Documentation/replace: state that objects must be of the same type
A previous patch ensures that both the replaced and the replacement objects passed to git replace must be of the same type, except if -f option is used. While at it state that there is no other restriction on both objects. Signed-off-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 277336a commit 160df71

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/git-replace.txt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@ The name of the 'replace' reference is the SHA-1 of the object that is
2020
replaced. The content of the 'replace' reference is the SHA-1 of the
2121
replacement object.
2222

23+
The replaced object and the replacement object must be of the same type.
24+
This restriction can be bypassed using `-f`.
25+
2326
Unless `-f` is given, the 'replace' reference must not yet exist.
2427

28+
There is no other restriction on the replaced and replacement objects.
29+
2530
Replacement references will be used by default by all Git commands
2631
except those doing reachability traversal (prune, pack transfer and
2732
fsck).
@@ -69,9 +74,7 @@ go back to a replaced commit will move the branch to the replacement
6974
commit instead of the replaced commit.
7075

7176
There may be other problems when using 'git rev-list' related to
72-
pending objects. And of course things may break if an object of one
73-
type is replaced by an object of another type (for example a blob
74-
replaced by a commit).
77+
pending objects.
7578

7679
SEE ALSO
7780
--------

0 commit comments

Comments
 (0)