author | Daniel Barkalow <barkalow@iabervon.org> | |
Thu, 7 Feb 2008 16:40:23 +0000 (11:40 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 16 Feb 2008 23:05:02 +0000 (15:05 -0800) | ||
commit | 782c2d65c24066a5d83453efb52763bc34c10f81 | |
tree | 41b91bb0a0f1a5461ca7efd46f0976951a38be65 | tree | snapshot |
parent | c369e7b805f927bb87fcf345dd19a55c8b9e6b8e | commit | diff |
Build in checkout
The only differences in behavior should be:
- git checkout -m with non-trivial merging won't print out
merge-recursive messages (see the change in t7201-co.sh)
- git checkout -- paths... will give a sensible error message if
HEAD is invalid as a commit.
- some intermediate states which were written to disk in the shell
version (in particular, index states) are only kept in memory in
this version, and therefore these can no longer be revealed by
later write operations becoming impossible.
- when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
rr-cache/MERGE_RR, like reset always has.
I'm not 100% sure I got the merge recursive setup exactly right; the
base for a non-trivial merge in the shell code doesn't seem
theoretically justified to me, but I tried to match it anyway, and the
tests all pass this way.
Other than these items, the results should be identical to the shell
version, so far as I can tell.
[jc: squashed lock-file fix from Dscho in]
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The only differences in behavior should be:
- git checkout -m with non-trivial merging won't print out
merge-recursive messages (see the change in t7201-co.sh)
- git checkout -- paths... will give a sensible error message if
HEAD is invalid as a commit.
- some intermediate states which were written to disk in the shell
version (in particular, index states) are only kept in memory in
this version, and therefore these can no longer be revealed by
later write operations becoming impossible.
- when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
rr-cache/MERGE_RR, like reset always has.
I'm not 100% sure I got the merge recursive setup exactly right; the
base for a non-trivial merge in the shell code doesn't seem
theoretically justified to me, but I tried to match it anyway, and the
tests all pass this way.
Other than these items, the results should be identical to the shell
version, so far as I can tell.
[jc: squashed lock-file fix from Dscho in]
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | diff | blob | history | |
builtin-checkout.c | [new file with mode: 0644] | blob |
builtin.h | diff | blob | history | |
contrib/examples/git-checkout.sh | [new file with mode: 0755] | blob |
git-checkout.sh | [deleted file] | blob | history |
git.c | diff | blob | history | |
t/t7201-co.sh | diff | blob | history |