diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-01-10 00:48:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-01-10 00:48:47 -0800 |
commit | 96aa7adda3b0254e4b9904f53bb38cd76bfea7bb (patch) | |
tree | d1eb57fbedb2e8c321889794c60ded86a9a2e88b /builtin-checkout.c | |
parent | 70d7099916c9621e157c620f9cc7fc982f109c55 (diff) | |
parent | 0606c36a73449e76d8f6133253c1eff291ee8c97 (diff) | |
download | git-96aa7adda3b0254e4b9904f53bb38cd76bfea7bb.tar.gz |
Merge branch 'maint-1.6.0' into maint-1.6.1
* maint-1.6.0:
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".
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 b5dd9c07b4..f32b14838d 100644 --- a/builtin-checkout.c +++ b/builtin-checkout.c @@ -403,7 +403,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)); @@ -426,7 +426,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 */ |