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

[PATCH 7/9] Export create_branch() from builtin-branch.c

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Feb 4, 2008, 18:36 UTC
Message-ID
<alpine.LNX.1.00.0802041336010.13593@iabervon.org>
You can also create branches, in exactly the same way, with checkout -b.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
---
 builtin-branch.c |    4 ++--
 cache.h          |    4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-branch.c b/builtin-branch.c
index 089cae5..04e377d 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -422,8 +422,8 @@ static int setup_tracking(const char *new_ref, const char *orig_ref)
 	return 0;
 }
 
-static void create_branch(const char *name, const char *start_name,
-			  int force, int reflog, int track)
+void create_branch(const char *name, const char *start_name,
+		   int force, int reflog, int track)
 {
 	struct ref_lock *lock;
 	struct commit *commit;
diff --git a/cache.h b/cache.h
index e4aeff0..97edbf1 100644
--- a/cache.h
+++ b/cache.h
@@ -680,6 +680,10 @@ extern int convert_to_working_tree(const char *path, const char *src, size_t len
 /* add */
 void add_files_to_cache(int verbose, const char *prefix, const char **pathspec);
 
+/* branch */
+void create_branch(const char *name, const char *start_name,
+		   int force, int reflog, int track);
+
 /* diff.c */
 extern int diff_auto_refresh_index;
 
-- 
1.5.4
Next: Johannes Schindelin
Message 1 of 3 in “Export create_branch() from builtin-branch.c”
  1. 7/9 Export create_branch() from builtin-branch.cDaniel Barkalow, Feb 4, 2008
  2. Johannes SchindelinFeb 5, 2008
  3. Daniel BarkalowFeb 5, 2008

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.