Skip to content

Commit

Permalink
Merge branch 'jk/maint-upload-archive'
Browse files Browse the repository at this point in the history
* jk/maint-upload-archive:
  archive: re-allow HEAD:Documentation on a remote invocation
  • Loading branch information
gitster committed Jan 13, 2012
2 parents c4a01a3 + 0f544ee commit bdb8cb5
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,23 @@ static void parse_treeish_arg(const char **argv,
/* Remotes are only allowed to fetch actual refs */
if (remote) {
char *ref = NULL;
if (!dwim_ref(name, strlen(name), sha1, &ref))
die("no such ref: %s", name);
const char *refname, *colon = NULL;

colon = strchr(name, ':');
if (colon)
refname = xstrndup(name, colon - name);
else
refname = name;

if (!dwim_ref(refname, strlen(refname), sha1, &ref))
die("no such ref: %s", refname);
if (refname != name)
free((void *)refname);
free(ref);
}
else {
if (get_sha1(name, sha1))
die("Not a valid object name");
}

if (get_sha1(name, sha1))
die("Not a valid object name");

commit = lookup_commit_reference_gently(sha1, 1);
if (commit) {
Expand Down

0 comments on commit bdb8cb5

Please sign in to comment.