aboutsummaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-31 16:30:44 -0700
committerJunio C Hamano <gitster@pobox.com>2014-03-31 16:30:44 -0700
commitf7804e250dfceb9695eddc11862054e2f9ca29c7 (patch)
tree60139d6075a52c654e16bff1e150b62d56cb5b9d /fsck.c
parentfa73d354689aa577d564b03d22f87c34b6288a78 (diff)
parenteffd12ec876df016d4346fee0d3d6bf31308fa11 (diff)
downloadgit-f7804e250dfceb9695eddc11862054e2f9ca29c7.tar.gz
git-f7804e250dfceb9695eddc11862054e2f9ca29c7.tar.xz
Merge branch 'hs/simplify-bit-setting-in-fsck-tree'
* hs/simplify-bit-setting-in-fsck-tree: fsck: use bitwise-or assignment operator to set flag
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/fsck.c b/fsck.c
index b3022ad98..abed62bac 100644
--- a/fsck.c
+++ b/fsck.c
@@ -165,18 +165,12 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func)
sha1 = tree_entry_extract(&desc, &name, &mode);
- if (is_null_sha1(sha1))
- has_null_sha1 = 1;
- if (strchr(name, '/'))
- has_full_path = 1;
- if (!*name)
- has_empty_name = 1;
- if (!strcmp(name, "."))
- has_dot = 1;
- if (!strcmp(name, ".."))
- has_dotdot = 1;
- if (!strcmp(name, ".git"))
- has_dotgit = 1;
+ has_null_sha1 |= is_null_sha1(sha1);
+ has_full_path |= !!strchr(name, '/');
+ has_empty_name |= !*name;
+ has_dot |= !strcmp(name, ".");
+ has_dotdot |= !strcmp(name, "..");
+ has_dotgit |= !strcmp(name, ".git");
has_zero_pad |= *(char *)desc.buffer == '0';
update_tree_entry(&desc);