diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-22 23:12:00 +0100 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2023-04-22 23:17:32 +0100 |
commit | 190a4c55df72b32adf4d60f77cbc47276b74f84b (patch) | |
tree | 896d6d41c2ea6305992bd646bbbe79a3fdb5f6fe /src/libgit2/ident.c | |
parent | e288f874a3a73ef31f88bb524f6d25d5ff3c5a3a (diff) | |
parent | 8a62616f43fe5ea37d41296f40293ff97aa88cfa (diff) | |
download | libgit2-190a4c55df72b32adf4d60f77cbc47276b74f84b.tar.gz |
Merge remote-tracking branch 'origin/main' into shallow-clone-network
Diffstat (limited to 'src/libgit2/ident.c')
-rw-r--r-- | src/libgit2/ident.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libgit2/ident.c b/src/libgit2/ident.c index bf9a4998e..97110c664 100644 --- a/src/libgit2/ident.c +++ b/src/libgit2/ident.c @@ -42,7 +42,7 @@ static int ident_find_id( static int ident_insert_id( git_str *to, const git_str *from, const git_filter_source *src) { - char oid[GIT_OID_SHA1_HEXSIZE+1]; + char oid[GIT_OID_MAX_HEXSIZE + 1]; const char *id_start, *id_end, *from_end = from->ptr + from->size; size_t need_size; @@ -57,7 +57,7 @@ static int ident_insert_id( return GIT_PASSTHROUGH; need_size = (size_t)(id_start - from->ptr) + - 5 /* "$Id: " */ + GIT_OID_SHA1_HEXSIZE + 2 /* " $" */ + + 5 /* "$Id: " */ + GIT_OID_MAX_HEXSIZE + 2 /* " $" */ + (size_t)(from_end - id_end); if (git_str_grow(to, need_size) < 0) @@ -65,7 +65,7 @@ static int ident_insert_id( git_str_set(to, from->ptr, (size_t)(id_start - from->ptr)); git_str_put(to, "$Id: ", 5); - git_str_put(to, oid, GIT_OID_SHA1_HEXSIZE); + git_str_puts(to, oid); git_str_put(to, " $", 2); git_str_put(to, id_end, (size_t)(from_end - id_end)); |