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
This commit is contained in:
@ -44,6 +44,15 @@ static void set_refspecs(const char **refs, int nr)
|
||||
strcat(tag, refs[i]);
|
||||
ref = tag;
|
||||
}
|
||||
if (!strcmp("HEAD", ref)) {
|
||||
unsigned char sha1_dummy[20];
|
||||
ref = resolve_ref(ref, sha1_dummy, 1, NULL);
|
||||
if (!ref)
|
||||
die("HEAD cannot be resolved.");
|
||||
if (prefixcmp(ref, "refs/heads/"))
|
||||
die("HEAD cannot be resolved to branch.");
|
||||
ref = xstrdup(ref + 11);
|
||||
}
|
||||
add_refspec(ref);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user