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

Re: [PATCH] t1503: test rev-parse --verify --quiet with deleted reflogs

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 15, 2014, 18:25 UTC
Message-ID
<xmqqppew7nbt.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140914185403.GA93515@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 14 quoted lines
>> > +test_expect_success 'fails silently when using -q with deleted reflogs' '
>> > +	ref=$(git rev-parse HEAD) &&
>> > +	: >.git/logs/refs/test &&
>> > +	git update-ref -m test refs/test "$ref" &&
>> 
>> I'm just curious, why not simply
>> 
>>    git branch test
>> ?
>
> Maybe it's a bad reason, but I wanted to replicate the behavior
> that git stash expects -- it writes to a ref outside of
> refs/heads/.  I thought it'd be good to exercise that same
> machinery since it will involve different code paths.

I think that is a very sensible thing to do. Another reason to avoid using "branch" when you care about what "update-ref" does is that "branch" does more than what "update-ref" does.

Previous: Junio C Hamano
Message 5 of 5 in “t1503: test rev-parse --verify --quiet with deleted reflogs”
  1. t1503: test rev-parse --verify --quiet with deleted reflogsDavid Aguilar, Sep 14, 2014
  2. Fabian RuchSep 14, 2014
  3. David AguilarSep 14, 2014
  4. Junio C HamanoSep 15, 2014
  5. Junio C HamanoSep 15, 2014

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.