Skip to content

Commit aa99754

Browse files
committed
fix: Prioritize "Update url" over "Update hash" commit message
1 parent 04edf95 commit aa99754

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/git.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ pub fn createCommitMessage(
3838
new.pkg.info.version.get(pkgs.strs),
3939
});
4040
}
41-
if (!pkgs.strs.eql(new.pkg.linux_x86_64.hash, old.linux_x86_64.hash))
42-
return std.fmt.allocPrint(gpa, "{s}: Update hash", .{name});
4341
if (!pkgs.strs.eql(new.pkg.linux_x86_64.url, old.linux_x86_64.url))
4442
return std.fmt.allocPrint(gpa, "{s}: Update url", .{name});
43+
if (!pkgs.strs.eql(new.pkg.linux_x86_64.hash, old.linux_x86_64.hash))
44+
return std.fmt.allocPrint(gpa, "{s}: Update hash", .{name});
4545
if (options.description) {
4646
const new_desc = new.pkg.info.description.get(pkgs.strs) orelse "";
4747
const old_desc = old.info.description.get(pkgs.strs) orelse "";
@@ -127,7 +127,7 @@ test createCommitMessage {
127127
},
128128
);
129129
try expectCreateCommitMessage(
130-
"dipm: Update hash",
130+
"dipm: Update url",
131131
&pkgs,
132132
.{
133133
.name = try pkgs.strs.putStr(gpa, "dipm"),
@@ -156,7 +156,7 @@ test createCommitMessage {
156156
},
157157
);
158158
try expectCreateCommitMessage(
159-
"dipm: Update url",
159+
"dipm: Update hash",
160160
&pkgs,
161161
.{
162162
.name = try pkgs.strs.putStr(gpa, "dipm"),
@@ -179,8 +179,8 @@ test createCommitMessage {
179179
},
180180
.update = .{},
181181
.linux_x86_64 = .{
182-
.url = try pkgs.strs.putStr(gpa, "b"),
183-
.hash = try pkgs.strs.putStr(gpa, "a"),
182+
.url = try pkgs.strs.putStr(gpa, "a"),
183+
.hash = try pkgs.strs.putStr(gpa, "b"),
184184
},
185185
},
186186
);

0 commit comments

Comments
 (0)