summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-10 00:52:04 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-10 00:52:04 -0800
commit83b10ca25fd49d25561fd6344bd8e40b8987f50a (patch)
tree8a57673412f8a5d9ebc1ba59c2101119e8a5bf08 /builtin-checkout.c
parent15515b73716a6ead5a5a348a7d04cc7d73c74bff (diff)
parent8fb5d44a47dd3657c8be0de5dcf220935b04e98e (diff)
downloadgit-83b10ca25fd49d25561fd6344bd8e40b8987f50a.tar.gz
Merge branch 'maint'
* maint: 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 Documentation: tiny git config manual tweaks Documentation: git gc packs refs by default now checkout -m: do not try to fall back to --merge from an unborn branch
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 64f3a11ae1..2708669383 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -397,7 +397,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 */