Is "show-ref -h" a good test for an empty repository?

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

 



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@xxxxxxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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