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

Re: [StGit PATCH] Remove broken branch creation subtest

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 12, 2008, 18:06 UTC
Message-ID
<7vabjzhrsa.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080412124212.27748.21332.stgit@yoghurt>
Karl Hasselström <kha@treskal.com> writes:
Show 8 quoted lines
> This subtest has started to cause subsequent subtests to fail with
> recent versions of git. And I don't think we can blame this one on
> git. What the subtest does is:
>
>   1. Remove all files or directories called "foo" under .git/. This is
>      supposed to delete the "foo" branch and associated StGit files,
>      but what about packed refs? This isn't actually malfunctioning
>      yet as far as I can tell, but it's a ticking bomb.

With an additional "git branch -D foo" perhaps upfront before you manually "corrupt" the repository, this can be resurrected without disabling the test, can't it?

>   2. Create an empty file .git/refs/heads/foo. This is supposed to be
>      a "broken branch", and indeed it is -- for example, git show-ref
>      barfs on such a repository even if asked to only show a branch
>      other than foo!
You got me worried here.
 * "git show-ref" issues "error: refs/heads/foo points nowhere!" in all
   cases, which is not bad.
 * broken foo does not prevent "git show-ref" (no patterns) from carrying
   out its primary task.  It goes on showing others.  There is no bad here
   either.
 * "git show-ref refs/heads/foo" errors out with 1, which is Ok.
 * "git show-ref master" shows all the ones ending with "master", exits
   with 0, which is Ok.
Show 8 quoted lines
>   3. Makes sure that stg branch won't successfully create a "foo"
>      branch. I'm pretty sure this fails because git thinks the repo is
>      broken, not because stg handles it gracefully. This is what the
>      test is supposed to be testing, but if we wanted that, we'd need
>      a more detailed test.
>
>   4. Doesn't clean up the broken ref, which causes some subsequent
>      subtests to fail.

It may be worth fixing the test than working it around, if only cleaning up is the issue.

Previous: Karl HasselströmNext: Karl Hasselström
Message 2 of 4 in “Remove broken branch creation subtest”
  1. Remove broken branch creation subtestKarl Hasselström, Apr 12, 2008
  2. Junio C HamanoApr 12, 2008
  3. Karl HasselströmApr 13, 2008
  4. Fix problems in t1000-branch-createKarl Hasselström, Apr 13, 2008

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.