summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c078383)
raw | patch | inline | side by side (parent: c078383)
author | Matt McCutchen <matt@mattmccutchen.net> | |
Mon, 24 Nov 2008 06:55:22 +0000 (01:55 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 28 Nov 2008 02:35:28 +0000 (18:35 -0800) |
I think it's unnecessary to warn that the checkout has been forced due to an
unborn current branch if -f has been explicitly passed. For one project, I am
using git-new-workdir to create workdirs from a bare repository whose HEAD is
set to an unborn branch, and this warning started to irritate me.
Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
unborn current branch if -f has been explicitly passed. For one project, I am
using git-new-workdir to create workdirs from a bare repository whose HEAD is
set to an unborn branch, and this warning started to irritate me.
Signed-off-by: Matt McCutchen <matt@mattmccutchen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-checkout.c | patch | blob | history |
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 25845cdd5e6ed47a726b4be57929b9ec4d348fff..c107fd643a452edb016f7ad867d4b2a555d9abaf 100644 (file)
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
if (!opts->quiet && !old.path && old.commit && new->commit != old.commit)
describe_detached_head("Previous HEAD position was", old.commit);
- if (!old.commit) {
+ if (!old.commit && !opts->force) {
if (!opts->quiet) {
fprintf(stderr, "warning: You appear to be on a branch yet to be born.\n");
fprintf(stderr, "warning: Forcing checkout of %s.\n", new->name);