"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: tog: worktree vs. -r repo
To:
gameoftrees@openbsd.org
Date:
Fri, 18 Dec 2020 17:17:51 +0100

Download raw body.

Thread
Stefan Sperling:

> > What purpose does got_worktree_open() serve in the -r case?
> > Maybe just skip got_worktree_open() completely, so worktree==NULL?
> 
> Yes, you're right. The worktree is opened in order to lock it, but
> if we're never going to do anything with it, we might as well not
> open it in the first place. Is this better?
> 
> diff refs/heads/main refs/heads/togrflag

Yes, that's what I had in mind.  I have only cosmetic comments:

* In cmd_diff(), got_worktree_open() can also move into the
  "if (repo_path == NULL)" branch.

* Throughout, the preceding getcwd() can also move into the
  "if (repo_path == NULL)" branch.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de