diff --git a/include/tig/git.h b/include/tig/git.h index 44b87e390..7c828db27 100644 --- a/include/tig/git.h +++ b/include/tig/git.h @@ -36,10 +36,11 @@ /* Don't show staged unmerged entries. */ #define GIT_DIFF_STAGED_FILES(output_arg) \ - "git", "diff-index", (output_arg), "--diff-filter=ACDMRTXB", "-C", "--cached", "HEAD", "--", NULL + "git", "diff-index", (output_arg), "%(cmdlineargs)", "--diff-filter=ACDMRTXB", \ + "-C", "--cached", "HEAD", "--", NULL #define GIT_DIFF_UNSTAGED_FILES(output_arg) \ - "git", "diff-files", (output_arg), NULL + "git", "diff-files", (output_arg), "%(cmdlineargs)", NULL #define GIT_DIFF_BLAME(encoding_arg, context_arg, space_arg, new_name) \ GIT_DIFF_UNSTAGED(encoding_arg, context_arg, space_arg, "", new_name) diff --git a/src/status.c b/src/status.c index 18a166e23..6e3953b52 100644 --- a/src/status.c +++ b/src/status.c @@ -90,8 +90,13 @@ status_run(struct view *view, const char *argv[], char status, enum line_type ty struct status *unmerged = NULL; struct buffer buf; struct io io; + const char **status_argv = NULL; + bool ok = argv_format(view->env, &status_argv, argv, false, false) && + io_run(&io, IO_RD, repo.exec_dir, NULL, status_argv); - if (!io_run(&io, IO_RD, repo.exec_dir, NULL, argv)) + argv_free(status_argv); + free(status_argv); + if (!ok) return false; add_line_nodata(view, type);