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

Re: [PATCH v2] t: make many tests depend less on the refs being files

From
Jeff King <peff@peff.net>
Date
May 25, 2018, 08:59 UTC
Message-ID
<20180525085906.GA2948@sigill.intra.peff.net>
In-Reply-To
<615f57ad-7591-128a-0c42-660312d34ca2@alum.mit.edu>
On Fri, May 25, 2018 at 10:48:04AM +0200, Michael Haggerty wrote:
Show 17 quoted lines
> >  test_expect_success "multi-fetch works off a 'clean' repository" '
> > -	rm -r "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" "$GIT_DIR/logs" &&
> > +	rm -rf "$GIT_DIR/svn" "$GIT_DIR/refs/remotes" &&
> > +	git reflog expire --all --expire=all &&
> >  	mkdir "$GIT_DIR/svn" &&
> >  	git svn multi-fetch
> >  	'
> > 
> 
> `rm -rf "$GIT_DIR/refs/remotes"` is not kosher. I think it can be written
> 
>     printf 'option no-deref\ndelete %s\n' $(git for-each-ref
> --format='%(refname)' refs/remotes) | git update-ref --stdin
> 
> as long as the number of references doesn't exceed command-line limits.
> This will also take care of the reflogs. Another alternative would be to
> write it as a loop.
Perhaps:
  git for-each-ref --format="option no-deref%0adelete %(refname)" refs/remotes |
  git update-ref --stdin
-Peff
Previous: Michael HaggertyNext: Michael Haggerty
Message 4 of 7 in “t: make many tests depend less on the refs being files”
  1. t: make many tests depend less on the refs being filesChristian Couder, May 23, 2018
  2. Junio C HamanoMay 23, 2018
  3. Michael HaggertyMay 25, 2018
  4. Jeff KingMay 25, 2018
  5. Michael HaggertyMay 25, 2018
  6. Christian CouderMay 25, 2018
  7. Christian CouderMay 25, 2018

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.