git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is "show-ref -h" a good test for an empty repository?
@ 2008-09-06  0:45 Eric Gerlach
  2008-09-06  1:29 ` Jeff King
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Gerlach @ 2008-09-06  0:45 UTC (permalink / raw)
  To: git

Hi,

I'm trying to test to see if "git diff --cached" will fail because there 
are no existing commits.  I've come up with running "git show-ref -h -q" 
and testing its return value.  My hypothesis is: If and only if 
git-show-ref succeeds then git-diff will succeed.

Are my logic and assumptions sound?  I'm a bit out of my git comfort 
zone here, so I'd like to get some validation from some people who know 
better.

Thanks in advance for the help!

Cheers,

-- 
Eric Gerlach, Network Administrator
Federation of Students
University of Waterloo
p: (519) 888-4567 x36329
e: egerlach@feds.uwaterloo.ca

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

end of thread, other threads:[~2008-09-08 14:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-06  0:45 Is "show-ref -h" a good test for an empty repository? Eric Gerlach
2008-09-06  1:29 ` Jeff King
2008-09-07 14:21   ` Eric Gerlach
2008-09-07 15:50     ` Jeff King
2008-09-07 17:31       ` Junio C Hamano
2008-09-07 17:34         ` Jeff King
2008-09-08 13:24           ` Eric Gerlach
2008-09-08 14:42             ` Jeff King

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).