Skip to content

Commit b4524d3

Browse files
pcloudsgitster
authored andcommitted
revert: do not pass non-literal string as format to git_path()
This fixes the following warning. CC builtin/revert.o builtin/revert.c: In function ‘write_cherry_pick_head’: builtin/revert.c:311: warning: format not a string literal and no format arguments Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 017d1e1 commit b4524d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/revert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static void write_cherry_pick_head(struct commit *commit, const char *pseudoref)
308308

309309
strbuf_addf(&buf, "%s\n", sha1_to_hex(commit->object.sha1));
310310

311-
filename = git_path(pseudoref);
311+
filename = git_path("%s", pseudoref);
312312
fd = open(filename, O_WRONLY | O_CREAT, 0666);
313313
if (fd < 0)
314314
die_errno(_("Could not open '%s' for writing"), filename);

0 commit comments

Comments
 (0)