summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorMatt McCutchen <matt@mattmccutchen.net>2008-11-24 06:55:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-28 02:35:28 (GMT)
commit1510dbe380a24fdf303a3c0594752cfdc968cb12 (patch)
treed0bda0c0087f1e437917fdd6b0d5cb9e54bad226 /builtin-checkout.c
parentc07838371b116251b6c4bc62a2ba64109baf74f1 (diff)
downloadgit-1510dbe380a24fdf303a3c0594752cfdc968cb12.zip
git-1510dbe380a24fdf303a3c0594752cfdc968cb12.tar.gz
git-1510dbe380a24fdf303a3c0594752cfdc968cb12.tar.bz2
git checkout: don't warn about unborn branch if -f is already passed
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>
Diffstat (limited to 'builtin-checkout.c')
-rw-r--r--builtin-checkout.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 25845cd..c107fd6 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -421,7 +421,7 @@ static int switch_branches(struct checkout_opts *opts, struct branch_info *new)
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);