diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-12-04 17:07:10 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-12-04 17:07:10 -0800 |
commit | 9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068 (patch) | |
tree | d626f21e0b87a364d213d3fba26cc92d9fb5a3f6 /sha1_name.c | |
parent | f64c81d4282b1dacf2cf095bfb0f7708b99b3ecf (diff) | |
parent | 605b4978a105e2f40a353513f616be7d20f91c15 (diff) | |
download | git-9bbe6db85f368fc4f75cc9f6c4bfaf2269bf0068.tar.gz |
Merge branch 'sp/refspec-match'
* sp/refspec-match:
refactor fetch's ref matching to use refname_match()
push: use same rules as git-rev-parse to resolve refspecs
add refname_match()
push: support pushing HEAD to real branch name
Diffstat (limited to 'sha1_name.c')
-rw-r--r-- | sha1_name.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/sha1_name.c b/sha1_name.c index bd8fc05c4b..13e11645e1 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -239,23 +239,13 @@ static int ambiguous_path(const char *path, int len) return slash; } -static const char *ref_fmt[] = { - "%.*s", - "refs/%.*s", - "refs/tags/%.*s", - "refs/heads/%.*s", - "refs/remotes/%.*s", - "refs/remotes/%.*s/HEAD", - NULL -}; - int dwim_ref(const char *str, int len, unsigned char *sha1, char **ref) { const char **p, *r; int refs_found = 0; *ref = NULL; - for (p = ref_fmt; *p; p++) { + for (p = ref_rev_parse_rules; *p; p++) { unsigned char sha1_from_ref[20]; unsigned char *this_result; @@ -277,7 +267,7 @@ int dwim_log(const char *str, int len, unsigned char *sha1, char **log) int logs_found = 0; *log = NULL; - for (p = ref_fmt; *p; p++) { + for (p = ref_rev_parse_rules; *p; p++) { struct stat st; unsigned char hash[20]; char path[PATH_MAX]; |