[PATCH 36/43] run-command: track total number of commands run
- From
David Turner <dturner@twopensource.com>
- Date
- Sep 3, 2015, 01:55 UTC
- Message-ID
- <1441245313-11907-37-git-send-email-dturner@twopensource.com>
- In-Reply-To
- <1441245313-11907-1-git-send-email-dturner@twopensource.com>
Soon, the db refs backend will use this to restart read transactions after subcommands which might have modified the refs database.
Signed-off-by: David Turner <dturner@twopensource.com> --- run-command.c | 2 ++ run-command.h | 1 + 2 files changed, 3 insertions(+)
diff --git a/run-command.c b/run-command.c index 02aab3f..dc4882e 100644 --- a/run-command.c +++ b/run-command.c @@ -332,6 +332,7 @@ fail_pipe: cmd->err = fderr[0]; } + total_commands_run ++; trace_argv_printf(cmd->argv, "trace: run_command:"); fflush(NULL); @@ -542,6 +543,7 @@ int finish_command(struct child_process *cmd) return ret; } +int total_commands_run = 0; int run_command(struct child_process *cmd) { int code; diff --git a/run-command.h b/run-command.h index 5b4425a..3d5ffa5 100644 --- a/run-command.h +++ b/run-command.h @@ -119,4 +119,5 @@ struct async { int start_async(struct async *async); int finish_async(struct async *async); +extern int total_commands_run; #endif
-- 2.0.4.315.gad8727a-twtrsrc