git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] filter-branch tests/docs: avoid \t in sed regexes

From
Tomas Carnecky <tom@dbservice.com>
Date
Jul 29, 2010, 15:02 UTC
Message-ID
<4C519810.6090108@dbservice.com>
In-Reply-To
<201007291652.52506.trast@student.ethz.ch>
On 7/29/10 4:52 PM, Thomas Rast wrote:
Show 25 quoted lines
> Tomas Carnecky wrote:
>> *** t7003-filter-branch.sh ***
>> *   ok 17: use index-filter to move into a subdirectory
> 
> Oh, I know.  The test isn't correct, it should be something like the
> patch below.  Otherwise a failure in git-diff (namely that
> directorymoved:newsubdir is invalid) is never detected, and since the
> output in this case is empty, also the test -z succeeds.  Can you
> apply that and see if it makes the test fail for you?
> 
> diff --git i/t/t7003-filter-branch.sh w/t/t7003-filter-branch.sh
> index e90da6d..a8e0c48 100755
> --- i/t/t7003-filter-branch.sh
> +++ w/t/t7003-filter-branch.sh
> @@ -148,7 +148,9 @@ test_expect_success 'use index-filter to move into a subdirectory' '
>  	          GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
>  			git update-index --index-info &&
>  		  mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
> -	test -z "$(git diff HEAD directorymoved:newsubdir)"'
> +	git diff HEAD directorymoved:newsubdir > actual &&
> +	test ! -s actual
> +'
>  
>  test_expect_success 'stops when msg filter fails' '
>  	old=$(git rev-parse HEAD) &&

Now the test fails. And with the other patch applied on top of it, the test passes again.

tom
Previous: Thomas RastNext: Thomas Rast
Message 7 of 13 in “Using filter-branch to move repo contents in subdirectory”
  1. Adam MercerJul 29, 2010
  2. Thomas RastJul 29, 2010
  3. Adam MercerJul 29, 2010
  4. filter-branch tests/docs: avoid \t in sed regexesThomas Rast, Jul 29, 2010
  5. Tomas CarneckyJul 29, 2010
  6. Thomas RastJul 29, 2010
  7. Tomas CarneckyJul 29, 2010
  8. t7005: fix subdirectory-filter testThomas Rast, Jul 29, 2010
  9. Thomas RastJul 29, 2010
  10. Adam MercerAug 9, 2010
  11. Adam MercerAug 11, 2010
  12. Jeff KingAug 11, 2010
  13. Adam MercerAug 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.