Merge branch 'maint' of git://repo.or.cz/git/fastimport into maint
authorJunio C Hamano <junkio@cox.net>
Wed, 16 May 2007 19:13:55 +0000 (12:13 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 16 May 2007 19:13:55 +0000 (12:13 -0700)
* 'maint' of git://repo.or.cz/git/fastimport:
import-tars: Use the "Link indicator" to identify directories

Documentation/git-branch.txt
builtin-name-rev.c
git-compat-util.h
index 603f87f3b59358697da821ffe240be9caff43fa7..8dc5171f5e685ab18d466751710f44e8aba104b7 100644 (file)
@@ -136,7 +136,7 @@ $ git branch -D test               <2>
 +
 <1> delete remote-tracking branches "todo", "html", "man"
 <2> delete "test" branch even if the "master" branch does not have all
-commits from todo branch.
+commits from test branch.
 
 
 Notes
index c022224361b62b527aca7822920ac8ea896ae585..ef1638590722017ad2cacca7ce30098fd0392bd5 100644 (file)
@@ -58,7 +58,10 @@ static void name_rev(struct commit *commit,
                        parents = parents->next, parent_number++) {
                if (parent_number > 1) {
                        int len = strlen(tip_name);
-                       char *new_name = xmalloc(len + 8);
+                       char *new_name = xmalloc(len +
+                               1 + decimal_length(generation) +  /* ~<n> */
+                               1 + 2 +                           /* ^NN */
+                               1);
 
                        if (len > 2 && !strcmp(tip_name + len - 2, "^0"))
                                len -= 2;
index bd93b6257885d56fda7268ae88ea82f721a6707f..7ed8b88b1f3cef2562693bbf6d68e2e4cef9465b 100644 (file)
@@ -13,6 +13,9 @@
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
 
+/* Approximation of the length of the decimal representation of this type. */
+#define decimal_length(x)      ((int)(sizeof(x) * 2.56 + 0.5) + 1)
+
 #if !defined(__APPLE__) && !defined(__FreeBSD__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */