git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* bug: update hook failure doesn't prevent local deletion of a branch
@ 2007-07-25 11:50 Andy Parkins
  2007-07-27  4:13 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Parkins @ 2007-07-25 11:50 UTC (permalink / raw)
  To: Git Mailing List

Hello,

I wanted to delete a branch (let's call it "deleted-branch") from my public 
repository.  I ran this:

$ git push origin :deleted-branch
deleting 'refs/heads/deleted-branch'
 Also local refs/remotes/up/deleted-branch
*** Update hook: aborting
error: hooks/update exited with error code 1
error: hook declined to update refs/heads/deleted-branch
ng refs/heads/deleted-branch hook declined
error: failed to push to '/path/to/git/repo.git'

Coincidentally, my update hook happened to have a bug in it that prevented me 
from running the operation.

However, when I run the operation again...

$ git push origin :deleted-branch
deleting 'refs/heads/deleted-branch'
 Also local refs/remotes/up/deleted-branch
error: unlink(.git/refs/remotes/up/deleted-branch) failed: No such file or 
directory
error: Failed to delete

If the remote didn't get deleted, then it seems wrong that the local copy does 
get deleted.

Summary: when using git-push to delete a remote branch, and that deletion is 
disallowed by the update hook, the local tracking branch _is_ deleted.

Obviously, this isn't _that_ serious because it could be recovered again with 
a git-fetch; but it does make some scary looking errors.



Andy
-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

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

end of thread, other threads:[~2007-07-27  5:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-25 11:50 bug: update hook failure doesn't prevent local deletion of a branch Andy Parkins
2007-07-27  4:13 ` Junio C Hamano
2007-07-27  4:26   ` Shawn O. Pearce
2007-07-27  5:00     ` Junio C Hamano

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 NNTP newsgroup(s).