diff --git a/.clang-format b/.clang-format index 41969eca4b7459..af12a038f717f3 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,11 @@ UseTab: Always TabWidth: 8 IndentWidth: 8 ContinuationIndentWidth: 8 -ColumnLimit: 80 + +# While we recommend keeping column limit to 80, we don't want to +# enforce it as we generally are more lenient with this rule and +# prefer to prioritize readability. +ColumnLimit: 0 # C Language specifics Language: Cpp @@ -39,10 +43,9 @@ AlignConsecutiveDeclarations: false # int cccccccc; AlignEscapedNewlines: Left -# Align operands of binary and ternary expressions -# int aaa = bbbbbbbbbbb + -# cccccc; -AlignOperands: true +# Don't enforce alignment after linebreaks and instead +# rely on the ContinuationIndentWidth value. +AlignOperands: false # Don't align trailing comments # int a; // Comment a diff --git a/block-sha1/sha1.h b/block-sha1/sha1.h index 47bb9166368a70..72997cabfb8a25 100644 --- a/block-sha1/sha1.h +++ b/block-sha1/sha1.h @@ -21,4 +21,5 @@ void blk_SHA1_Final(unsigned char hashout[20], blk_SHA_CTX *ctx); #define platform_SHA1_Init blk_SHA1_Init #define platform_SHA1_Update blk_SHA1_Update #define platform_SHA1_Final blk_SHA1_Final +#define platform_SHA1_Test blk_SHA1_Test #endif diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 08656a15308ada..0190557672cf86 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -102,6 +102,7 @@ case "$jobname" in ClangFormat) sudo apt-get -q update sudo apt-get -q -y install clang-format + clang-format -version ;; StaticAnalysis) sudo apt-get -q update diff --git a/loose.c b/loose.c index 6d6a41b7e55a95..897ba389daa18c 100644 --- a/loose.c +++ b/loose.c @@ -1,10 +1,9 @@ -#define USE_THE_REPOSITORY_VARIABLE - #include "git-compat-util.h" #include "hash.h" #include "path.h" #include "object-store.h" #include "hex.h" +#include "repository.h" #include "wrapper.h" #include "gettext.h" #include "loose.h" @@ -142,8 +141,8 @@ int repo_write_loose_object_map(struct repository *repo) for (; iter != kh_end(map); iter++) { if (kh_exist(map, iter)) { - if (oideq(&kh_key(map, iter), the_hash_algo->empty_tree) || - oideq(&kh_key(map, iter), the_hash_algo->empty_blob)) + if (oideq(&kh_key(map, iter), repo->hash_algo->empty_tree) || + oideq(&kh_key(map, iter), repo->hash_algo->empty_blob)) continue; strbuf_addf(&buf, "%s %s\n", oid_to_hex(&kh_key(map, iter)), oid_to_hex(kh_value(map, iter))); if (write_in_full(fd, buf.buf, buf.len) < 0)