11diff --git a/Makefile b/Makefile
2- index 6bfb62cbe9..2230b40a9f 100644
2+ index 4e255c81f2..05905e3a2e 100644
33--- a/Makefile
44+++ b/Makefile
5- @@ -756 ,6 +756,11 @@ FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
5+ @@ -760 ,6 +760,19 @@ FUZZ_OBJS += oss-fuzz/fuzz-commit-graph.o
66 FUZZ_OBJS += oss-fuzz/fuzz-date.o
77 FUZZ_OBJS += oss-fuzz/fuzz-pack-headers.o
88 FUZZ_OBJS += oss-fuzz/fuzz-pack-idx.o
99+ FUZZ_OBJS += oss-fuzz/fuzz-command.o
1010+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-status.o
1111+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-version.o
1212+ FUZZ_OBJS += oss-fuzz/fuzz-cmd-diff.o
13+ + FUZZ_OBJS += oss-fuzz/fuzz-credential-from-url-gently.o
14+ + FUZZ_OBJS += oss-fuzz/fuzz-url-decode-mem.o
15+ + FUZZ_OBJS += oss-fuzz/fuzz-url-end-with-slash.o
16+ + FUZZ_OBJS += oss-fuzz/fuzz-parse-attr-line.o
17+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-bundle-verify.o
18+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-unpack-objects.o
19+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-apply-check.o
20+ + FUZZ_OBJS += oss-fuzz/fuzz-cmd-tag-create.o
1321+
1422 .PHONY: fuzz-objs
1523 fuzz-objs: $(FUZZ_OBJS)
1624
17- @@ -1085 ,6 +1089 ,7 @@ LIB_OBJS += oid-array.o
25+ @@ -1087 ,6 +1100 ,7 @@ LIB_OBJS += oid-array.o
1826 LIB_OBJS += oidmap.o
1927 LIB_OBJS += oidset.o
2028 LIB_OBJS += oidtree.o
2129+ LIB_OBJS += oss-fuzz/fuzz-cmd-base.o
2230 LIB_OBJS += pack-bitmap-write.o
2331 LIB_OBJS += pack-bitmap.o
2432 LIB_OBJS += pack-check.o
33+ @@ -3862,10 +3876,10 @@ FUZZ_CXXFLAGS ?= $(ALL_CFLAGS)
34+
35+ .PHONY: fuzz-all
36+
37+ - $(FUZZ_PROGRAMS): %: %.o oss-fuzz/dummy-cmd-main.o $(GITLIBS) GIT-LDFLAGS
38+ - $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) \
39+ + $(FUZZ_PROGRAMS): all
40+ + $(QUIET_LINK)$(CXX) $(FUZZ_CXXFLAGS) -o $@ $(ALL_LDFLAGS) $(BUILTIN_OBJS) \
41+ -Wl,--allow-multiple-definition \
42+ - $(filter %.o,$^) $(filter %.a,$^) $(LIBS) $(LIB_FUZZING_ENGINE)
43+ + $(filter %.o,$^) $(filter %.a,$^) git.o $@.o $(LIBS) $(LIB_FUZZING_ENGINE)
44+
45+ fuzz-all: $(FUZZ_PROGRAMS)
46+
47+ diff --git a/attr.c b/attr.c
48+ index 679e42258c..20e426726a 100644
49+ --- a/attr.c
50+ +++ b/attr.c
51+ @@ -351,7 +351,7 @@ static const char *parse_attr(const char *src, int lineno, const char *cp,
52+ return ep + strspn(ep, blank);
53+ }
54+
55+ - static struct match_attr *parse_attr_line(const char *line, const char *src,
56+ + struct match_attr *parse_attr_line(const char *line, const char *src,
57+ int lineno, unsigned flags)
58+ {
59+ size_t namelen, num_attr, i;
60+ diff --git a/builtin/bundle.c b/builtin/bundle.c
61+ index 3ad11dc5d0..2443906572 100644
62+ --- a/builtin/bundle.c
63+ +++ b/builtin/bundle.c
64+ @@ -123,7 +123,7 @@ static int open_bundle(const char *path, struct bundle_header *header,
65+ return read_bundle_header(path, header);
66+ }
67+
68+ - static int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
69+ + int cmd_bundle_verify(int argc, const char **argv, const char *prefix) {
70+ struct bundle_header header = BUNDLE_HEADER_INIT;
71+ int bundle_fd = -1;
72+ int quiet = 0;
73+ diff --git a/builtin/tag.c b/builtin/tag.c
74+ index 37473ac21f..c719ea10e7 100644
75+ --- a/builtin/tag.c
76+ +++ b/builtin/tag.c
77+ @@ -589,8 +589,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
78+ if (repo_get_oid(the_repository, object_ref, &object))
79+ die(_("Failed to resolve '%s' as a valid ref."), object_ref);
80+
81+ - if (strbuf_check_tag_ref(&ref, tag))
82+ - die(_("'%s' is not a valid tag name."), tag);
83+ + if (strbuf_check_tag_ref(&ref, tag)) {
84+ + //die(_("'%s' is not a valid tag name."), tag);
85+ + ret = 1;
86+ + goto cleanup;
87+ + }
88+
89+ if (read_ref(ref.buf, &prev))
90+ oidclr(&prev);
2591diff --git a/diff.c b/diff.c
26- index 648f6717a5..24e42d0cd1 100644
92+ index ccfa1fca0d..97f895a122 100644
2793--- a/diff.c
2894+++ b/diff.c
29- @@ -3557 ,7 +3557 ,7 @@ static void builtin_diff(const char *name_a,
95+ @@ -3654 ,7 +3654 ,7 @@ static void builtin_diff(const char *name_a,
3096 }
3197 if (fill_mmfile(o->repo, &mf1, one) < 0 ||
3298 fill_mmfile(o->repo, &mf2, two) < 0)
@@ -35,7 +101,25 @@ index 648f6717a5..24e42d0cd1 100644
35101 /* Quite common confusing case */
36102 if (mf1.size == mf2.size &&
37103 !memcmp(mf1.ptr, mf2.ptr, mf1.size)) {
38- @@ -4009,7 +4009,7 @@ int diff_populate_filespec(struct repository *r,
104+ @@ -3837,7 +3837,7 @@ static void builtin_diffstat(const char *name_a, const char *name_b,
105+
106+ if (fill_mmfile(o->repo, &mf1, one) < 0 ||
107+ fill_mmfile(o->repo, &mf2, two) < 0)
108+ - die("unable to read files to diff");
109+ + return;//die("unable to read files to diff");
110+
111+ memset(&xpp, 0, sizeof(xpp));
112+ memset(&xecfg, 0, sizeof(xecfg));
113+ @@ -3900,7 +3900,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b,
114+
115+ if (fill_mmfile(o->repo, &mf1, one) < 0 ||
116+ fill_mmfile(o->repo, &mf2, two) < 0)
117+ - die("unable to read files to diff");
118+ + return;//die("unable to read files to diff");
119+
120+ /*
121+ * All the other codepaths check both sides, but not checking
122+ @@ -4106,7 +4106,7 @@ int diff_populate_filespec(struct repository *r,
39123 conv_flags = CONV_EOL_RNDTRP_WARN;
40124
41125 if (!DIFF_FILE_VALID(s))
@@ -44,7 +128,7 @@ index 648f6717a5..24e42d0cd1 100644
44128 if (S_ISDIR(s->mode))
45129 return -1;
46130
47- @@ -4113 ,7 +4113 ,7 @@ int diff_populate_filespec(struct repository *r,
131+ @@ -4210 ,7 +4210 ,7 @@ int diff_populate_filespec(struct repository *r,
48132 }
49133 if (oid_object_info_extended(r, &s->oid, &info,
50134 OBJECT_INFO_LOOKUP_REPLACE))
@@ -53,7 +137,7 @@ index 648f6717a5..24e42d0cd1 100644
53137
54138 object_read:
55139 if (size_only || check_binary) {
56- @@ -4128 ,7 +4128 ,7 @@ int diff_populate_filespec(struct repository *r,
140+ @@ -4225 ,7 +4225 ,7 @@ int diff_populate_filespec(struct repository *r,
57141 info.contentp = &s->data;
58142 if (oid_object_info_extended(r, &s->oid, &info,
59143 OBJECT_INFO_LOOKUP_REPLACE))
@@ -62,7 +146,7 @@ index 648f6717a5..24e42d0cd1 100644
62146 }
63147 s->should_free = 1;
64148 }
65- @@ -7051 ,7 +7051 ,7 @@ size_t fill_textconv(struct repository *r,
149+ @@ -7226 ,7 +7226 ,7 @@ size_t fill_textconv(struct repository *r,
66150 return 0;
67151 }
68152 if (diff_populate_filespec(r, df, NULL))
@@ -71,7 +155,7 @@ index 648f6717a5..24e42d0cd1 100644
71155 *outbuf = df->data;
72156 return df->size;
73157 }
74- @@ -7069 ,7 +7069 ,7 @@ size_t fill_textconv(struct repository *r,
158+ @@ -7244 ,7 +7244 ,7 @@ size_t fill_textconv(struct repository *r,
75159
76160 *outbuf = run_textconv(r, driver->textconv, df, &size);
77161 if (!*outbuf)
@@ -81,10 +165,10 @@ index 648f6717a5..24e42d0cd1 100644
81165 if (driver->textconv_cache && df->oid_valid) {
82166 /* ignore errors, as we might be in a readonly repository */
83167diff --git a/environment.c b/environment.c
84- index 18d042b467..7e0ba9dc47 100644
168+ index 90632a39bc..29e7c0479f 100644
85169--- a/environment.c
86170+++ b/environment.c
87- @@ -265 ,7 +265 ,7 @@ void set_git_work_tree(const char *new_work_tree)
171+ @@ -271 ,7 +271 ,7 @@ void set_git_work_tree(const char *new_work_tree)
88172 strbuf_release(&realpath);
89173 return;
90174 }
0 commit comments