Skip to content

Commit 782c2d6

Browse files
iabervongitster
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c369e7b commit 782c2d6

File tree

6 files changed

+481
-8
lines changed

6 files changed

+481
-8
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ BASIC_CFLAGS =
217217
BASIC_LDFLAGS =
218218

219219
SCRIPT_SH = \
220-
git-bisect.sh git-checkout.sh \
220+
git-bisect.sh \
221221
git-clone.sh \
222222
git-merge-one-file.sh git-mergetool.sh git-parse-remote.sh \
223223
git-pull.sh git-rebase.sh git-rebase--interactive.sh \
@@ -329,6 +329,7 @@ BUILTIN_OBJS = \
329329
builtin-bundle.o \
330330
builtin-cat-file.o \
331331
builtin-check-attr.o \
332+
builtin-checkout.o \
332333
builtin-checkout-index.o \
333334
builtin-check-ref-format.o \
334335
builtin-clean.o \

0 commit comments

Comments
 (0)