diff options
| author | Junio C Hamano <gitster@pobox.com> | 2011-12-09 13:37:09 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2011-12-09 13:37:09 -0800 |
| commit | eb8aa3d2c2849cb3a44396b89054339df38e2bfa (patch) | |
| tree | 7af351487a380753f89376e78a9c860378d28bfb /strbuf.c | |
| parent | a4043aeafed7962716a513e38ca1d5e192e7e831 (diff) | |
| parent | 96b8d93a539f3a9f43f0fc38214db8753cac3c2e (diff) | |
| download | git-eb8aa3d2c2849cb3a44396b89054339df38e2bfa.tar.xz | |
Merge branch 'jc/pull-signed-tag'
* jc/pull-signed-tag:
commit-tree: teach -m/-F options to read logs from elsewhere
commit-tree: update the command line parsing
commit: teach --amend to carry forward extra headers
merge: force edit and no-ff mode when merging a tag object
commit: copy merged signed tags to headers of merge commit
merge: record tag objects without peeling in MERGE_HEAD
merge: make usage of commit->util more extensible
fmt-merge-msg: Add contents of merged tag in the merge message
fmt-merge-msg: package options into a structure
fmt-merge-msg: avoid early returns
refs DWIMmery: use the same rule for both "git fetch" and others
fetch: allow "git fetch $there v1.0" to fetch a tag
merge: notice local merging of tags and keep it unwrapped
fetch: do not store peeled tag object names in FETCH_HEAD
Split GPG interface into its own helper library
Conflicts:
builtin/fmt-merge-msg.c
builtin/merge.c
Diffstat (limited to 'strbuf.c')
| -rw-r--r-- | strbuf.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -397,3 +397,17 @@ int strbuf_read_file(struct strbuf *sb, const char *path, size_t hint) return len; } + +void strbuf_add_lines(struct strbuf *out, const char *prefix, + const char *buf, size_t size) +{ + while (size) { + const char *next = memchr(buf, '\n', size); + next = next ? (next + 1) : (buf + size); + strbuf_addstr(out, prefix); + strbuf_add(out, buf, next - buf); + size -= next - buf; + buf = next; + } + strbuf_complete_line(out); +} |
