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

Re: [PATCH v4 3/4] receive-pack: Protect current branch for bare repository worktree

From
Anders Kaseorg <andersk@mit.edu>
Date
Nov 9, 2021, 23:03 UTC
Message-ID
<2f983e36-532f-ac87-9ade-fba4c6b9d276@mit.edu>
In-Reply-To
<nycvar.QRO.7.76.6.2111091717230.54@tvgsbejvaqbjf.bet>
On 11/9/21 08:22, Johannes Schindelin wrote:
> While `find_shared_symref()` currently won't return a `worktree` with a
> non-zero `is_bare`, to future-proof the code we might want to turn the
> `if (worktree)` below (8 lines outside the current diff context) into `if
> (worktree && !worktree->is_bare)`.
Will do.
Show 5 quoted lines
>> +test_expect_success 'denyCurrentBranch and bare repository worktrees' '
>> +	test_when_finished "rm -fr bare.git" &&
> 
> While `wt/` will be created inside `bare.git` and therefore be removed,
> the branch `wt` won't. Maybe add `&& git branch -D wt`?
The branch ‘wt’ is inside bare.git.
> I like fruit, too! Apple, banana, grape, yummy. I wonder what's next :-)
Yay!
> Maybe make sure that `bare.git/wt/grape.t` exists? We do want the worktree
> to be updated, after all...
Right, I’d forgotten this one.  Will do.
Thanks all for the helpful reviews!
Anders
Previous: Johannes SchindelinNext: Anders Kaseorg
Message 12 of 34 in “receive-pack: Protect current branch for bare repository worktree”
  1. 2/2 receive-pack: Protect current branch for bare repository worktreeAnders Kaseorg, Nov 8, 2021
  2. Junio C HamanoNov 8, 2021
  3. Junio C HamanoNov 9, 2021
  4. Johannes SchindelinNov 9, 2021
  5. Anders KaseorgNov 9, 2021
  6. 1/4 fetch: Protect branches checked out in all worktreesAnders Kaseorg, Nov 9, 2021
  7. 2/4 receive-pack: Clean dead code from update_worktree()Anders Kaseorg, Nov 9, 2021
  8. Johannes SchindelinNov 9, 2021
  9. Anders KaseorgNov 9, 2021
  10. 3/4 receive-pack: Protect current branch for bare repository worktreeAnders Kaseorg, Nov 9, 2021
  11. Johannes SchindelinNov 9, 2021
  12. Anders KaseorgNov 9, 2021
  13. 1/4 fetch: Protect branches checked out in all worktreesAnders Kaseorg, Nov 9, 2021
  14. 3/4 receive-pack: Protect current branch for bare repository worktreeAnders Kaseorg, Nov 9, 2021
  15. Ævar Arnfjörð BjarmasonNov 10, 2021
  16. 4/4 branch: Protect branches checked out in all worktreesAnders Kaseorg, Nov 9, 2021
  17. Ævar Arnfjörð BjarmasonNov 10, 2021
  18. 2/4 receive-pack: Clean dead code from update_worktree()Anders Kaseorg, Nov 9, 2021
  19. Ævar Arnfjörð BjarmasonNov 10, 2021
  20. Johannes SchindelinNov 10, 2021
  21. Ævar Arnfjörð BjarmasonNov 10, 2021
  22. Johannes SchindelinNov 10, 2021
  23. Junio C HamanoNov 10, 2021
  24. Junio C HamanoNov 11, 2021
  25. Junio C HamanoNov 10, 2021
  26. Anders KaseorgNov 10, 2021
  27. 4/4 branch: Protect branches checked out in all worktreesAnders Kaseorg, Nov 9, 2021
  28. Johannes SchindelinNov 9, 2021
  29. Johannes SchindelinNov 9, 2021
  30. Anders KaseorgNov 9, 2021
  31. Junio C HamanoNov 9, 2021
  32. Junio C HamanoNov 9, 2021
  33. Anders KaseorgNov 9, 2021
  34. Johannes SchindelinNov 9, 2021

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.