git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Detached checkout will clobber branch head when using symlink HEAD
@ 2008-10-15 18:24 Matt Draisey
  2008-10-16 19:17 ` Jeff King
  0 siblings, 1 reply; 15+ messages in thread
From: Matt Draisey @ 2008-10-15 18:24 UTC (permalink / raw)
  To: git

The faulty code appears to be this

git 1.6.0.2.526.g5c283
builtin-checkout.c

>    481	static void update_refs_for_switch(struct checkout_opts *opts,

>    500		if (new->path) {
> 
>    511		} else if (strcmp(new->name, "HEAD")) {
>    512			update_ref(msg.buf, "HEAD", new->commit->object.sha1, NULL,
>    513				   REF_NODEREF, DIE_ON_ERR);
>    514			if (!opts->quiet) {
>    515				if (old->path)
>    516					fprintf(stderr, "Note: moving to \"%s\" which isn't a local branch\nIf you want to create a new branch from this checkout, you may do so\n(now or later) by using -b with the checkout command again. Example:\n  git checkout -b <new_branch_name>\n", new->name);
>    517				describe_detached_head("HEAD is now at", new->commit);
>    518			}
>    519		}

If HEAD is a symlink rather than a "ref:" style link this is really bad.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2008-10-19 19:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-15 18:24 Detached checkout will clobber branch head when using symlink HEAD Matt Draisey
2008-10-16 19:17 ` Jeff King
2008-10-16 20:11   ` Matt Draisey
2008-10-16 20:20     ` Nicolas Pitre
2008-10-16 20:22       ` Jeff King
2008-10-16 20:30         ` Nicolas Pitre
2008-10-16 20:28       ` Matt Draisey
2008-10-16 20:47         ` Nicolas Pitre
2008-10-16 20:39     ` Jeff King
2008-10-17 23:08       ` Junio C Hamano
2008-10-17 23:10         ` [PATCH 1/3] demonstrate breakage of detached checkout with symbolic link HEAD Junio C Hamano
2008-10-17 23:10         ` [PATCH 2/3] Enhance hold_lock_file_for_{update,append}() API Junio C Hamano
2008-10-17 23:11         ` [PATCH 3/3] Fix checkout not to clobber the branch when using symlinked HEAD upon detaching Junio C Hamano
2008-10-19 13:00         ` Detached checkout will clobber branch head when using symlink HEAD Jeff King
2008-10-19 19:36           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).