Re: [PATCH] git-symbolic-ref: fix error message when ref doesn't exist
- From
Junio C Hamano <junkio@cox.net>
- Date
- Mar 19, 2007, 08:47 UTC
- Message-ID
- <7vslc1iprn.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <20070318020645.2444.75365.julian@quantumfyre.co.uk>
Julian Phillips <julian@quantumfyre.co.uk> writes:
> When calling resolve_ref from check_symref set reading to 1, since we > do want to know if the given ref doesn't exist. This means that > "git symbolic-ref foo" will now print "fatal: No such ref: foo" as > expected.
Hmmmm. That would break:
$ rm -fr a; mkdir a; cd a
$ git init-db
$ git symbolic-ref HEAD
refs/heads/masterwouldn't it? We do want it not to fail and tell us that the commit we are going to create will be on refs/heads/master (i.e. "the master branch").
And the command errors out as expected when given a non-existent symbolic ref:
$ git symbolic-ref no-such; echo $? fatal: ref no-such is not a symbolic ref 128