Merge branch 'jc/maint-1.7.3-checkout-describe'

* jc/maint-1.7.3-checkout-describe:
  checkout -b <name>: correctly detect existing branch
This commit is contained in:
Junio C Hamano
2011-06-29 17:03:12 -07:00
4 changed files with 19 additions and 1 deletions

6
refs.c
View File

@ -1826,6 +1826,12 @@ int update_ref(const char *action, const char *refname,
return 0;
}
int ref_exists(char *refname)
{
unsigned char sha1[20];
return !!resolve_ref(refname, sha1, 1, NULL);
}
struct ref *find_ref_by_name(const struct ref *list, const char *name)
{
for ( ; list; list = list->next)