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

Cannot delete remote branch with non-ascii name and --force-with-lease

From
FBFrej Bjon <frej.bjon@nemit.fi>
Date
Jul 15, 2020, 09:10 UTC
Message-ID
<CAP8P1T+JQUTVDXsJbrWkiZ2AWZmoptFSRdKssANYrNSFa+Egmg@mail.gmail.com>
What did you do before the bug happened? (Steps to reproduce your issue)
- Create a branch with non-ascii character: testbranch-ä
- Push to a remote with same name
- Delete branch from remote with --force-with-lease:
  git --force-with-lease --delete origin "testbranch-ä"
What did you expect to happen? (Expected behavior)
- The branch to be deleted.
What happened instead? (Actual behavior)
- Git fails with an error
  error: cannot parse expected object name
'32e33fb544d7b1147c446c60220f23a5df465eff"'
Anything else you want to add:
- The command works if using only --force and not --force-with-lease
- The command works if there's no non-ascii character, e.g. "testbranch-x"
- Tested with gitlab and github as remotes, with the same error
- My locale in git bash is "en_US.UTF-8"
- The same happens under Ubuntu 20.04 with git 2.25.1

[System Info] git version: git version 2.27.0.windows.1 cpu: x86_64 built from commit: 907ab1011dce9112700498e034b974ba60f8b407 sizeof-long: 4 sizeof-size_t: 8 uname: Windows 10.0 15063 compiler info: gnuc: 10.1 libc info: no libc information available

[Enabled Hooks] None

Regards, Frej Bjon

Next: brian m. carlson
Message 1 of 4 in “Cannot delete remote branch with non-ascii name and --force-with-lease”
  1. Frej BjonJul 15, 2020
  2. remote-curl: make --force-with-lease work with non-ASCII ref namesbrian m. carlson, Jul 20, 2020
  3. Junio C HamanoJul 21, 2020
  4. remote-curl: make --force-with-lease work with non-ASCII ref namesbrian m. carlson, Jul 21, 2020

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.