git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git push --delete <url> <branch> fails if run outside a repository
@ 2022-06-06  8:05 Adam Dinwoodie
  2022-06-06 17:29 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Dinwoodie @ 2022-06-06  8:05 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 783 bytes --]

When using `git push`, rather than specifying a remote by name, one can
also specify a remote by URL, and this includes when the only operations
being performed are to delete refs on the remote.  This doesn't require
any information about any local repository, but it fails unless the
command is run from within an existing local Git repo.

This seems like a bug to me: there's no reason this shouldn't work.
Clearly low priority, though, as this is a rare use case, and there's a
simple workaround: just `cd` into any existing Git repo, or create a
temporary empty repo to run the command from.

Simple test case attached; I've verified the behaviour the test script
demonstrates on Git v2.36.1 on Cygwin, and on Git v2.34.1 (strictly,
v2.34.1-1~bpo11) on Debian 11.

Cheers,

Adam

[-- Attachment #2: git-push-delete-bug.sh --]
[-- Type: application/x-sh, Size: 422 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-06 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-06  8:05 git push --delete <url> <branch> fails if run outside a repository Adam Dinwoodie
2022-06-06 17:29 ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).