refactor(hash)!: added TreeDiffObject and changed the name from DiffObject to FileDiffObject
This commit is contained in:
parent
b4dff29a5c
commit
252bdc281e
2 changed files with 4 additions and 2 deletions
|
|
@ -8,8 +8,9 @@
|
|||
|
||||
typedef enum {
|
||||
BaseFileObject,
|
||||
DiffObject,
|
||||
FileDiffObject,
|
||||
TreeObject,
|
||||
TreeDiffObject
|
||||
} ObjectType;
|
||||
|
||||
void object_hash(ObjectType, char*, char*);
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ void object_hash(ObjectType obj_type, char* content, char* hex_hash) {
|
|||
int header_len;
|
||||
switch (obj_type) {
|
||||
case BaseFileObject: header_len = snprintf(header, sizeof(header), "basefile %zu", content_len); break;
|
||||
case DiffObject: header_len = snprintf(header, sizeof(header), "diff %zu", content_len); break;
|
||||
case FileDiffObject: header_len = snprintf(header, sizeof(header), "filediff %zu", content_len); break;
|
||||
case TreeObject: header_len = snprintf(header, sizeof(header), "tree %zu", content_len); break;
|
||||
case TreeDiffObject: header_len = snprintf(header, sizeof(header), "treediff %zu", content_len); break;
|
||||
default: header_len = 0; break;
|
||||
}
|
||||
header[header_len] = '\0';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue