diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-18 21:37:12 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-18 21:37:12 -0800 |
commit | 03c6e97f809e5b89089a2c689d6a319e8d471455 (patch) | |
tree | 35c4f6f2b801f9979feb2aee65578b575bac39bd /builtin-checkout.c | |
parent | Prevent git blame from segfaulting on a missing author name (diff) | |
parent | Merge branch 'maint-1.6.3' into maint-1.6.4 (diff) | |
download | tgif-03c6e97f809e5b89089a2c689d6a319e8d471455.tar.xz |
Merge branch 'maint-1.6.4' into maint-1.6.5
* maint-1.6.4:
Fix mis-backport of t7002
base85: Make the code more obvious instead of explaining the non-obvious
base85: encode_85() does not use the decode table
base85 debug code: Fix length byte calculation
checkout -m: do not try to fall back to --merge from an unborn branch
branch: die explicitly why when calling "git branch [-a|-r] branchname".
textconv: stop leaking file descriptors
commit: --cleanup is a message option
git count-objects: handle packs bigger than 4G
t7102: make the test fail if one of its check fails
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r-- | builtin-checkout.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c index d050c3789f..f2786fe439 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -396,7 +396,7 @@ static int merge_working_tree(struct checkout_opts *opts, topts.initial_checkout = is_cache_unborn(); topts.update = 1; topts.merge = 1; - topts.gently = opts->merge; + topts.gently = opts->merge && old->commit; topts.verbose_update = !opts->quiet; topts.fn = twoway_merge; topts.dir = xcalloc(1, sizeof(*topts.dir)); @@ -421,7 +421,13 @@ static int merge_working_tree(struct checkout_opts *opts, struct merge_options o; if (!opts->merge) return 1; - parse_commit(old->commit); + + /* + * Without old->commit, the below is the same as + * the two-tree unpack we already tried and failed. + */ + if (!old->commit) + return 1; /* Do more real merge */ |