Skip to content

Commit bc35baf

Browse files
committed
fix: quote date range arguments for robust CLI parsing
- Quote the values for --since and --until options to handle arguments containing spaces or special characters Signed-off-by: appleboy <[email protected]>
1 parent 87e5623 commit bc35baf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/git/repo_commit.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,10 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
241241
gitCmd.AddOptionValues("--not", opts.Not)
242242
}
243243
if opts.Since != "" {
244-
gitCmd.AddOptionFormat("--since=%s", opts.Since)
244+
gitCmd.AddOptionFormat("--since='%s'", opts.Since)
245245
}
246246
if opts.Until != "" {
247-
gitCmd.AddOptionFormat("--until=%s", opts.Until)
247+
gitCmd.AddOptionFormat("--until='%s'", opts.Until)
248248
}
249249

250250
gitCmd.AddDashesAndList(opts.File)

0 commit comments

Comments
 (0)