projects
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6fc4a7e
)
builtin-clone: use strbuf in guess_dir_name()
author
Miklos Vajna
<vmiklos@frugalware.org>
Fri, 21 Nov 2008 00:44:59 +0000
(
01:44
+0100)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 25 Nov 2008 23:34:25 +0000
(15:34 -0800)
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clone.c
patch
|
blob
|
history
diff --git
a/builtin-clone.c
b/builtin-clone.c
index 8e1a1d399580af3faa39c3c50350b3ca19df0634..275b690b3c053595e013f9594f5bfbc2c03e3503 100644
(file)
--- a/
builtin-clone.c
+++ b/
builtin-clone.c
@@
-134,9
+134,9
@@
static char *guess_dir_name(const char *repo, int is_bundle, int is_bare)
}
if (is_bare) {
-
char *result = xmalloc(end - start + 5)
;
- s
printf(
result, "%.*s.git", (int)(end - start), start);
- return
result
;
+
struct strbuf result = STRBUF_INIT
;
+ s
trbuf_addf(&
result, "%.*s.git", (int)(end - start), start);
+ return
strbuf_detach(&result, 0)
;
}
return xstrndup(start, end - start);