Detached checkout will clobber branch head when using symlink HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux