]> git.ipfire.org Git - thirdparty/git.git/commitdiff
odb: rename `odb_write_object()` flags
authorPatrick Steinhardt <ps@pks.im>
Tue, 31 Mar 2026 23:57:48 +0000 (01:57 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Apr 2026 03:43:13 +0000 (20:43 -0700)
Rename `odb_write_object()` flags to be properly prefixed with the
function name.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
object-file.c
odb.h

index 60bcc07c3b83579688c01e35c7b35b42902d597e..60059edfb0b6807b6fa579084624b1750168c343 100644 (file)
@@ -456,7 +456,7 @@ static int update_one(struct cache_tree *it,
                hash_object_file(the_hash_algo, buffer.buf, buffer.len,
                                 OBJ_TREE, &it->oid);
        } else if (odb_write_object_ext(the_repository->objects, buffer.buf, buffer.len, OBJ_TREE,
-                                       &it->oid, NULL, flags & WRITE_TREE_SILENT ? WRITE_OBJECT_SILENT : 0)) {
+                                       &it->oid, NULL, flags & WRITE_TREE_SILENT ? ODB_WRITE_OBJECT_SILENT : 0)) {
                strbuf_release(&buffer);
                return -1;
        }
index 4f77ce0982625d996b189d8e6a70e3013f32260d..db1a420ab6d4e6016edc2e81581cc11fb0b393f3 100644 (file)
@@ -909,7 +909,7 @@ static int start_loose_object_common(struct odb_source *source,
 
        fd = create_tmpfile(source->odb->repo, tmp_file, filename);
        if (fd < 0) {
-               if (flags & WRITE_OBJECT_SILENT)
+               if (flags & ODB_WRITE_OBJECT_SILENT)
                        return -1;
                else if (errno == EACCES)
                        return error(_("insufficient permission for adding "
@@ -1042,7 +1042,7 @@ static int write_loose_object(struct odb_source *source,
                utb.actime = mtime;
                utb.modtime = mtime;
                if (utime(tmp_file.buf, &utb) < 0 &&
-                   !(flags & WRITE_OBJECT_SILENT))
+                   !(flags & ODB_WRITE_OBJECT_SILENT))
                        warning_errno(_("failed utime() on %s"), tmp_file.buf);
        }
 
diff --git a/odb.h b/odb.h
index 09affaf6a58e67726ecd76948aed1d9365190000..083c25609e59e843c688fa714877c70c9f1aec24 100644 (file)
--- a/odb.h
+++ b/odb.h
@@ -568,12 +568,12 @@ enum {
         * changes that so that the object will be written as a loose object
         * and persisted.
         */
-       WRITE_OBJECT_PERSIST = (1 << 0),
+       ODB_WRITE_OBJECT_PERSIST = (1 << 0),
 
        /*
         * Do not print an error in case something goes wrong.
         */
-       WRITE_OBJECT_SILENT = (1 << 1),
+       ODB_WRITE_OBJECT_SILENT = (1 << 1),
 };
 
 /*