@@ -1366,7 +1366,7 @@ static int verify_hdr(struct cache_header *hdr, unsigned long size)
1366
1366
and is called before git_config(git_default_config, ...)
1367
1367
the config values are not loaded and has to be retrieved directly here.
1368
1368
*/
1369
- if (gvfs_config_load_and_is_set (GVFS_SKIP_SHA_ON_INDEX_READ ))
1369
+ if (gvfs_config_load_and_is_set (GVFS_SKIP_SHA_ON_INDEX ))
1370
1370
return 0 ;
1371
1371
1372
1372
git_SHA1_Init (& c );
@@ -1735,7 +1735,8 @@ static int ce_write_flush(git_SHA_CTX *context, int fd)
1735
1735
{
1736
1736
unsigned int buffered = write_buffer_len ;
1737
1737
if (buffered ) {
1738
- git_SHA1_Update (context , write_buffer , buffered );
1738
+ if (!gvfs_config_is_set (GVFS_SKIP_SHA_ON_INDEX ))
1739
+ git_SHA1_Update (context , write_buffer , buffered );
1739
1740
if (write_in_full (fd , write_buffer , buffered ) != buffered )
1740
1741
return -1 ;
1741
1742
write_buffer_len = 0 ;
@@ -1780,7 +1781,8 @@ static int ce_flush(git_SHA_CTX *context, int fd, unsigned char *sha1)
1780
1781
1781
1782
if (left ) {
1782
1783
write_buffer_len = 0 ;
1783
- git_SHA1_Update (context , write_buffer , left );
1784
+ if (!gvfs_config_is_set (GVFS_SKIP_SHA_ON_INDEX ))
1785
+ git_SHA1_Update (context , write_buffer , left );
1784
1786
}
1785
1787
1786
1788
/* Flush first if not enough space for SHA1 signature */
@@ -1791,7 +1793,10 @@ static int ce_flush(git_SHA_CTX *context, int fd, unsigned char *sha1)
1791
1793
}
1792
1794
1793
1795
/* Append the SHA1 signature at the end */
1794
- git_SHA1_Final (write_buffer + left , context );
1796
+ if (!gvfs_config_is_set (GVFS_SKIP_SHA_ON_INDEX ))
1797
+ git_SHA1_Final (write_buffer + left , context );
1798
+ else
1799
+ hashclr (write_buffer + left );
1795
1800
hashcpy (sha1 , write_buffer + left );
1796
1801
left += 20 ;
1797
1802
return (write_in_full (fd , write_buffer , left ) != left ) ? -1 : 0 ;
0 commit comments