Re: [PATCH 1/3] t7900-subtree.sh: fix quoting and broken && chains

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

 



Eric Sunshine <sunshine@xxxxxxxxxxxxxx> writes:

>> @@ -73,10 +73,10 @@ join_commits()
>>  test_create_commit() (
>>         repo=$1
>>         commit=$2
>
> Perhaps &&-chain the above two lines also to future-proof against
> someone inserting important code somewhere above the following 'cd'.

Yup, also we can have them on a single line, i.e.

	repo=$1 commit=$2 &&
	cd "$repo" &&
        ...

Thanks

>
>> -       cd "$repo"
>> -       mkdir -p $(dirname "$commit") \
>> +       cd "$repo" &&
>> +       mkdir -p "$(dirname "$commit")" \
>>         || error "Could not create directory for commit"
>> -       echo "$commit" >"$commit"
>> +       echo "$commit" >"$commit" &&
>>         git add "$commit" || error "Could not add commit"
>>         git commit -m "$commit" || error "Could not commit"
>>  )
--
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]