public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* t2017 test failure in pu
@ 2014-09-08 10:56 Ramsay Jones
  0 siblings, 0 replies; only message in thread
From: Ramsay Jones @ 2014-09-08 10:56 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: GIT Mailing-list

Hi Junio,

The current 'pu' branch has a test failure for me, namely test
t2017-checkout-orphan.sh #9.

I had a quick squint at the conflict resolution in commit acdbdf99 and
the only thing that seemed relevant was the dropping of the
'log_all_ref_updates' dance. So, I quickly put it back, like so:

    diff --git a/builtin/checkout.c b/builtin/checkout.c
    index 18a4519..de27a1b 100644
    --- a/builtin/checkout.c
    +++ b/builtin/checkout.c
    @@ -602,9 +602,15 @@ static void update_refs_for_switch(const struct checkout_opts *opts,
     		if (opts->new_orphan_branch) {
     			if (opts->new_branch_log && !log_all_ref_updates) {
     				const char *ref_name;
    +				int ret, temp;
     
     				ref_name = mkpath("refs/heads/%s", opts->new_orphan_branch);
    -				if (create_reflog(ref_name)) {
    +				temp = log_all_ref_updates;
    +				log_all_ref_updates = 1;
    +				ret = create_reflog(ref_name);
    +				log_all_ref_updates = temp;
    +
    +				if (ret) {
     					fprintf(stderr, _("Can not do reflog for '%s'\n"),
     					    opts->new_orphan_branch);
     					return;

and everything works again. (I've only just noticed that the 'dance'
is now within a conditional such that "!log_all_ref_updates" is true, so
that the above can be simplified!)

I guess 'create_reflog' should be called 'maybe_create_reflog' :-D

HTH

ATB,
Ramsay Jones

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-08 10:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-08 10:56 t2017 test failure in pu Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox