Skip to contentSkip to conversation

builtin/trailers: don't always run all commands

PATCH New Michael S. Tsirkin 1 participant 1 message Jun 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 builtin/trailers: don't always run all commands

If an explicit -t trailer is used, only parse
trailers from command line.

---
 trailer.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
trailer.c +8 -4
index 8e5be91..34654fc 100644
@@ -676,10 +676,14 @@ static struct trailer_item *process_command_line_args(struct string_list *traile
 	struct trailer_item *item;
 
 	/* Add a trailer item for each configured trailer with a command */
-	for (item = first_conf_item; item; item = item->next) {
-		if (item->conf.command) {
-			struct trailer_item *new = new_trailer_item(item, NULL, NULL);
-			add_trailer_item(&arg_tok_first, &arg_tok_last, new);
+	if (!trailers->nr) {
+		for (item = first_conf_item; item; item = item->next) {
+			if (item->conf.command) {
+				struct trailer_item *new =
+					new_trailer_item(item, NULL, NULL);
+				add_trailer_item(&arg_tok_first,
+						 &arg_tok_last, new);
+			}
 		}
 	}
 
Signature · 1 line
MST