Re: [PATCH v2] t: make many tests depend less on the refs being files
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