summaryrefslogtreecommitdiff
path: root/builtin-checkout.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-28 03:23:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-11-28 03:23:51 (GMT)
commit455d0f5c23a600ff8c94642ca5123f1bd2f1ec0d (patch)
treed6674efc969ac919afdaf98202aab53a14d20871 /builtin-checkout.c
parent608efb875f89a946d5cb37b2dd4077132618e0e1 (diff)
parent539eec48f0a101b45c5f150a2bbc067fd85bc96d (diff)
downloadgit-455d0f5c23a600ff8c94642ca5123f1bd2f1ec0d.zip
git-455d0f5c23a600ff8c94642ca5123f1bd2f1ec0d.tar.gz
git-455d0f5c23a600ff8c94642ca5123f1bd2f1ec0d.tar.bz2
Merge branch 'maint'
* maint: sha1_file.c: resolve confusion EACCES vs EPERM sha1_file: avoid bogus "file exists" error message git checkout: don't warn about unborn branch if -f is already passed bash: offer refs instead of filenames for 'git revert' bash: remove dashed command leftovers git-p4: fix keyword-expansion regex fast-export: use an unsorted string list for extra_refs Add new testcase to show fast-export does not always exports all tags
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 464fd25..7f3bd7b 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -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);