Re: [PATCH] git-p4: warn if git authorship won't be retained

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

 



Luke Diamand <luke@xxxxxxxxxxx> writes:

> diff --git a/t/t9800-git-p4.sh b/t/t9800-git-p4.sh
> index 4fb0e24..d6c7d13 100755
> --- a/t/t9800-git-p4.sh
> +++ b/t/t9800-git-p4.sh
> @@ -160,6 +160,15 @@ p4_check_commit_author() {
>      fi
>  }
>  
> +make_change_by_user() {
> +	file=$1
> +	name=$2
> +	email=$3

	file=$1 name=$2 email=$3 &&

> +	echo "username: a change by $name" >> $file &&
> ...
> @@ -213,6 +222,43 @@ test_expect_success 'preserve user where author is unknown to p4' '
>  	rm -rf "$git" && mkdir "$git"
>  '
>  
> +# If we're *not* using --preserve-user, git-p4 should warn if we're submitting
> +# changes that are not all ours.
> +# Test: user in p4 and user unknown to p4.
> +# Test: warning disabled and user is the same.
> +test_expect_success 'not preserving user with mixed authorship' '
> +	"$GITP4" clone --dest="$git" //depot &&
> +	cd "$git" &&
> +	git config git-p4.skipSubmitEditCheck true
> +	p4_add_user derek Derek &&
> + ...
> +	p4_check_commit_author usernamefile3 alice &&
> +	cd "$TRASH_DIRECTORY" &&
> +	rm -rf "$git" && mkdir "$git"
> +'

When the commands in the && chain fails after 'cd "$git"' near the top but
not before 'cd "$TRASH_DIRECTORY"' near the end, you would end up starting
the next test from somewhere different from "$TRASH_DIRECTORY".

Do it like this instead:

	"$GITP4" clone --dest="$git" //depot &&
        (
        	cd "$git" &&
                ...
	) &&
        rm -fr "$git"

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