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]

 



Christian Couder <chriscool@xxxxxxxxxxxxx> writes:

> @@ -43,7 +46,8 @@ If you are sure you want to delete it, r
>  	    ;;
>  	esac
>  	rm -f "$GIT_DIR/logs/refs/heads/$branch_name"
> -	rm -f "$GIT_DIR/refs/heads/$branch_name"
> +	echo $NULL_SHA1 > "$GIT_DIR/refs/heads/$branch_name" || \
> +	    die "Failed to delete branch '$branch_name' !"

Don't you need mkdir -p somewhere?

> diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh
> index 5b04efc..150dfdc 100755
> --- a/t/t3200-branch.sh
> +++ b/t/t3200-branch.sh
> @@ -47,7 +47,7 @@ test_expect_success \
>  test_expect_success \
>      'git branch -d d/e/f should delete a branch and a log' \
>  	'git-branch -d d/e/f &&
> -	 test ! -f .git/refs/heads/d/e/f &&
> +	 ! git-show-ref --verify --quiet -- "refs/heads/d/e/f" &&
>  	 test ! -f .git/logs/refs/heads/d/e/f'

I am old-fashioned and it makes me think twice when I see people
do "! command" in shell.  Bash and dash has support for it, and
opengroup has it in its base specification, so probably it is
Ok.

As usual, Solaris /bin/sh does not grok it ;-).

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