git push --delete <url> <branch> fails if run outside a repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: git-push-delete-bug.sh
Description: Bourne shell script


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux