Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/pipeline/pass_githistory.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,16 @@ static int parse_git_log(const char *repo_path, commit_t **out, int *out_count)
}

char cmd[CBM_SZ_1K];
#ifdef _WIN32
/* cmd.exe does not recognize single quotes; '/dev/null' is a POSIX path. */
const char *null_dev = "NUL";
#else
const char *null_dev = "/dev/null";
#endif
snprintf(cmd, sizeof(cmd),
"cd '%s' && git log --name-only --pretty=format:COMMIT:%%H "
"--since='1 year ago' --max-count=10000 2>/dev/null",
repo_path);
"git -C \"%s\" log --name-only --pretty=format:COMMIT:%%H "
"--since=\"1 year ago\" --max-count=10000 2>%s",
repo_path, null_dev);

FILE *fp = cbm_popen(cmd, "r");
if (!fp) {
Expand Down