diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-01-31 17:21:49 +0100 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-01-31 17:29:53 +0100 |
commit | 279afd2a514160754eeba8e5db84600486f70761 (patch) | |
tree | 418280985b624d9b005db6a1ec9d56c5efda3329 /src/refspec.c | |
parent | f25cc58d5cd630aa379bf894c5b78feb824bb647 (diff) | |
download | libgit2-279afd2a514160754eeba8e5db84600486f70761.tar.gz |
refspec: a ref name includes the refs/ prefix
git_refspec_transform_r assumed that the reference name passed would
be only a branch or tag name. This is not the case, and we need to
take into consideration what's in the refspec's source to know how
much of the prefix to ignore.
Diffstat (limited to 'src/refspec.c')
-rw-r--r-- | src/refspec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/refspec.c b/src/refspec.c index 7694be525..48265bcde 100644 --- a/src/refspec.c +++ b/src/refspec.c @@ -107,7 +107,7 @@ int git_refspec_transform_r(git_buf *out, const git_refspec *spec, const char *n return GIT_SUCCESS; git_buf_truncate(out, out->size - 1); /* remove trailing '*' */ - git_buf_puts(out, name); + git_buf_puts(out, name + strlen(spec->src) - 1); return git_buf_lasterror(out); } |