t1512: skip test if not using SHA-1
[gitweb.git] / sha1-file.c
index 77ccaab928529d37aa971168c54e31358e12ef8e..46072602fff00bc08960f08568e8bdb84255c60e 100644 (file)
@@ -23,6 +23,7 @@
 #include "sha1-lookup.h"
 #include "bulk-checkin.h"
 #include "repository.h"
+#include "replace-object.h"
 #include "streaming.h"
 #include "dir.h"
 #include "list.h"
@@ -141,7 +142,7 @@ static int get_conv_flags(unsigned flags)
        if (flags & HASH_RENORMALIZE)
                return CONV_EOL_RENORMALIZE;
        else if (flags & HASH_WRITE_OBJECT)
-         return global_conv_flags_eol;
+               return global_conv_flags_eol | CONV_WRITE_OBJECT;
        else
                return 0;
 }
@@ -1239,7 +1240,7 @@ int oid_object_info_extended(const struct object_id *oid, struct object_info *oi
        int already_retried = 0;
 
        if (flags & OBJECT_INFO_LOOKUP_REPLACE)
-               real = lookup_replace_object(oid);
+               real = lookup_replace_object(the_repository, oid);
 
        if (is_null_oid(real))
                return -1;
@@ -1383,8 +1384,8 @@ void *read_object_file_extended(const struct object_id *oid,
        const struct packed_git *p;
        const char *path;
        struct stat st;
-       const struct object_id *repl = lookup_replace ? lookup_replace_object(oid)
-                                                     : oid;
+       const struct object_id *repl = lookup_replace ?
+               lookup_replace_object(the_repository, oid) : oid;
 
        errno = 0;
        data = read_object(repl->hash, type, size);