Makefile: introduce NO_PTHREADS
[gitweb.git] / builtin-checkout.c
index 464fd2570735485a35d34c4aa8d50e5a1930228c..7f3bd7bb1cb8f211c78067df9376541e0aa3f923 100644 (file)
@@ -553,7 +553,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);