diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-28 02:40:22 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-05-28 02:40:22 +0200 |
| commit | c7f94123569e8fe00ffb3a35e6a12b6ebe9320ec (patch) | |
| tree | 2439954e67e7fac7867c062b822e53f350a30173 /src | |
| parent | c11daac9de2fb582873e2471346526f33835226e (diff) | |
| parent | 1ecbcd8e51032529435a9e714802f2502293b050 (diff) | |
| download | libgit2-c7f94123569e8fe00ffb3a35e6a12b6ebe9320ec.tar.gz | |
Merge pull request #3160 from b4n/ident-same-as-git
Fix ident replacement to match Git behavior
Diffstat (limited to 'src')
| -rw-r--r-- | src/ident.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ident.c b/src/ident.c index 6bc80abc7..4718ed664 100644 --- a/src/ident.c +++ b/src/ident.c @@ -56,7 +56,7 @@ static int ident_insert_id( return GIT_PASSTHROUGH; need_size = (size_t)(id_start - from->ptr) + - 5 /* "$Id: " */ + GIT_OID_HEXSZ + 1 /* "$" */ + + 5 /* "$Id: " */ + GIT_OID_HEXSZ + 2 /* " $" */ + (size_t)(from_end - id_end); if (git_buf_grow(to, need_size) < 0) @@ -65,7 +65,7 @@ static int ident_insert_id( git_buf_set(to, from->ptr, (size_t)(id_start - from->ptr)); git_buf_put(to, "$Id: ", 5); git_buf_put(to, oid, GIT_OID_HEXSZ); - git_buf_putc(to, '$'); + git_buf_put(to, " $", 2); git_buf_put(to, id_end, (size_t)(from_end - id_end)); return git_buf_oom(to) ? -1 : 0; |
