Re: [PATCH] Remove branch by putting a null sha1 into the ref file.

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

 




On Mon, 18 Sep 2006, Christian Couder wrote:
>
> With the new packed ref file format from Linus, this should be
> the new way to remove a branch.

Well, it's not really sufficient.

Somebody should add this test-case

	git branch test
	git branch -d test
	git branch test/first

which should work.

It's entirely possible that the proper way to do branch deletion with 
packed branches is to simply re-pack without the old branch, rather than 
the negative branch model. I couldn't really decide.

However: this part is definitely correct, considering that we allow the 
null sha1 in other places.

> "refs.c" is fixed so that a null sha1 for a deleted branch does
> not result in "refs/head/deleted does not point to a valid
> commit object!" messages.

And this last part is conceptually ok, but I think the implementaion is 
wrong:

> "t/t3200-branch.sh" is fixed so that it uses git-show-ref
> instead of checking that the ref does not exist when a branch
> is deleted.

I think you should change the

	! git-show-ref --verify --quiet -- "refs/heads/d/e/f" &&

into

	git-show-ref --verify --quiet -- "refs/heads/d/e/f" ||

instead, no?

		Linus
-
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]