git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/3] wt-status.c: Move has_unmerged earlier in the file.

From
SSStephen P. Smith <ischis2@cox.net>
Date
Sep 1, 2018, 23:52 UTC
Message-ID
<20180901235256.4260-2-ischis2@cox.net>
In-Reply-To
<20180901235256.4260-1-ischis2@cox.net>

Move has_unmerged up in the file so that has_unmerged can be called in wt_status_collect where we need to place a merge check.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
---
 wt-status.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index 5ffab6101..180faf6ba 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -724,6 +724,19 @@ static void wt_status_collect_untracked(struct wt_status *s)
 		s->untracked_in_ms = (getnanotime() - t_begin) / 1000000;
 }
 
+static int has_unmerged(struct wt_status *s)
+{
+	int i;
+
+	for (i = 0; i < s->change.nr; i++) {
+		struct wt_status_change_data *d;
+		d = s->change.items[i].util;
+		if (d->stagemask)
+			return 1;
+	}
+	return 0;
+}
+
 void wt_status_collect(struct wt_status *s)
 {
 	wt_status_collect_changes_worktree(s);
@@ -1063,19 +1076,6 @@ static void wt_longstatus_print_tracking(struct wt_status *s)
 	strbuf_release(&sb);
 }
 
-static int has_unmerged(struct wt_status *s)
-{
-	int i;
-
-	for (i = 0; i < s->change.nr; i++) {
-		struct wt_status_change_data *d;
-		d = s->change.items[i].util;
-		if (d->stagemask)
-			return 1;
-	}
-	return 0;
-}
-
 static void show_merge_in_progress(struct wt_status *s,
 				struct wt_status_state *state,
 				const char *color)
-- 
2.18.0
Previous: Stephen P. SmithNext: Stephen P. Smith
Message 2 of 7 in “wt-status.c: commitable flag”
  1. 0/3 wt-status.c: commitable flagStephen P. Smith, Sep 1, 2018
  2. 1/3 wt-status.c: Move has_unmerged earlier in the file.Stephen P. Smith, Sep 1, 2018
  3. 2/3 Add test for commit --dry-run --short.Stephen P. Smith, Sep 1, 2018
  4. Eric SunshineSep 2, 2018
  5. Eric SunshineSep 2, 2018
  6. Stephen & Linda SmithSep 2, 2018
  7. 3/3 wt-status.c: Set the commitable flag in the collect phase.Stephen P. Smith, Sep 1, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.