Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-10 11:49:47 +0300
committerJunio C Hamano <gitster@pobox.com>2010-01-10 11:49:47 +0300
commitc5034673fd92b6278e6c9d55683770ec01fafc89 (patch)
tree04435179aa4d3dfb0b2ac746072731929d7adcf1 /builtin-checkout.c
parent405923761a8cd12d0047c215b69df9c6aa96723e (diff)
parent96aa7adda3b0254e4b9904f53bb38cd76bfea7bb (diff)
Merge branch 'maint-1.6.1' into maint-1.6.2
* maint-1.6.1: 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 Conflicts: diff.c
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index ffdb33aef5..e0bbea58ff 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -399,7 +399,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));
@@ -422,7 +422,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 */