1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-05 00:37:55 +01:00
git/builtin
Jeff King 97b1b4f3a6 merge: merge unborn index before setting ref
When we merge into an unborn branch, there are basically two
steps:

  1. Write the sha1 of the new commit into the ref pointed
     to by HEAD.

  2. Update the index with the new content, and check it out
     to the working tree.

We currently do them in this order. However, (2) is the step
that is much more likely to fail, since it can be blocked by
things like untracked working tree files. When it does, the
merge fails and we are left with an empty index but an
updated HEAD.

This patch switches the order, so that a failure in updating
the index leaves us unchanged. Of course, a failure in
updating the ref now leaves us with an updated index and
mis-matched HEAD. That is arguably not much better, but it
is probably less likely to actually happen.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-03-25 14:16:01 -07:00
..
add.c Merge branch 'maint' 2011-03-16 16:59:30 -07:00
annotate.c
apply.c Merge branch 'jc/maint-apply-report-offset' 2011-03-15 14:22:02 -07:00
archive.c
bisect--helper.c
blame.c standardize brace placement in struct definitions 2011-03-16 12:49:02 -07:00
branch.c branch: split off function that writes tracking info and commit subject 2011-03-16 12:52:15 -07:00
bundle.c
cat-file.c
check-attr.c
check-ref-format.c
checkout-index.c Merge branch 'jn/git-cmd-h-bypass-setup' 2010-12-12 21:49:50 -08:00
checkout.c Merge branch 'jc/checkout-orphan-warning' 2011-03-15 14:22:16 -07:00
clean.c
clone.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
commit-tree.c
commit.c Merge branch 'jn/status-translatable' 2011-03-19 23:24:19 -07:00
config.c config: drop support for GIT_CONFIG_NOGLOBAL 2011-03-15 12:23:30 -07:00
count-objects.c
describe.c Merge branch 'lt/default-abbrev' 2011-03-23 14:55:40 -07:00
diff-files.c Convert struct diff_options to use struct pathspec 2011-02-03 12:28:15 -08:00
diff-index.c
diff-tree.c
diff.c Merge branch 'nd/struct-pathspec' 2011-02-27 21:17:36 -08:00
fast-export.c Merge branch 'mg/placeholders-are-lowercase' 2011-02-27 21:58:30 -08:00
fetch-pack.c Merge branch 'sp/maint-fetch-pack-stop-early' 2011-03-22 21:38:03 -07:00
fetch.c Merge branch 'jk/trace-sifter' 2011-03-19 23:24:12 -07:00
fmt-merge-msg.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
for-each-ref.c
fsck.c fsck: do not give up too early in fsck_dir() 2011-01-27 12:58:15 -08:00
gc.c Merge branch 'jn/git-cmd-h-bypass-setup' 2010-12-12 21:49:50 -08:00
grep.c grep: read patterns from stdin with -f - 2011-03-19 21:46:52 -07:00
hash-object.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
help.c
index-pack.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
init-db.c Name make_*_path functions more accurately 2011-03-17 16:08:30 -07:00
log.c Merge branch 'mm/maint-log-n-with-diff-filtering' 2011-03-19 23:25:38 -07:00
ls-files.c Merge branch 'jn/git-cmd-h-bypass-setup' 2010-12-12 21:49:50 -08:00
ls-remote.c get_remote_url(): use the same data source as ls-remote to get remote urls 2011-03-02 12:26:53 -08:00
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c
merge-file.c
merge-index.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-ours.c
merge-recursive.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge-tree.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
merge.c merge: merge unborn index before setting ref 2011-03-25 14:16:01 -07:00
mktag.c Merge branch 'jn/maint-c99-format' 2011-03-23 14:55:46 -07:00
mktree.c
mv.c
name-rev.c
notes.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
pack-objects.c thread-utils.h: simplify the inclusion 2010-12-10 12:58:06 -08:00
pack-redundant.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
pack-refs.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
patch-id.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
prune-packed.c
prune.c
push.c Merge branch 'jk/trace-sifter' 2011-03-19 23:24:12 -07:00
read-tree.c Make <identifier> lowercase as per CodingGuidelines 2011-02-15 11:53:10 -08:00
receive-pack.c Merge branch 'jc/maint-fetch-alt' 2011-03-22 21:37:53 -07:00
reflog.c
remote-ext.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
remote-fd.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
remote.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
replace.c
rerere.c rerere forget: deprecate invocation without pathspec 2011-03-02 12:26:18 -08:00
reset.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
rev-list.c rev-list/log: factor out revision mark generation 2011-03-09 13:50:54 -08:00
rev-parse.c
revert.c Merge branch 'js/cherry-pick-usability' 2011-03-09 15:56:17 -08:00
rm.c builtin/rm.c: Use ALLOC_GROW instead of alloc_nr and xrealloc. 2010-12-19 10:44:06 -08:00
send-pack.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
shortlog.c parse-options: Don't call parse_options_check() so much 2010-12-06 16:51:36 -08:00
show-branch.c
show-ref.c
stripspace.c
symbolic-ref.c
tag.c Make <identifier> lowercase as per CodingGuidelines 2011-02-15 11:53:10 -08:00
tar-tree.c
unpack-file.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
unpack-objects.c
update-index.c Convert ce_path_match() to use struct pathspec 2011-02-03 14:08:30 -08:00
update-ref.c
update-server-info.c
upload-archive.c
var.c Fix sparse warnings 2011-03-22 10:16:54 -07:00
verify-pack.c
verify-tag.c Merge branch 'mg/maint-tag-rfc1991' 2010-12-08 11:24:13 -08:00
write-tree.c