File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -381,6 +381,18 @@ int git_net_url_fmt(git_buf *buf, git_net_url *url)
381381 return git_buf_oom (buf ) ? -1 : 0 ;
382382}
383383
384+ int git_net_url_fmt_path (git_buf * buf , git_net_url * url )
385+ {
386+ git_buf_puts (buf , url -> path ? url -> path : "/" );
387+
388+ if (url -> query ) {
389+ git_buf_putc (buf , '?' );
390+ git_buf_puts (buf , url -> query );
391+ }
392+
393+ return git_buf_oom (buf ) ? -1 : 0 ;
394+ }
395+
384396void git_net_url_dispose (git_net_url * url )
385397{
386398 if (url -> username )
Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ extern void git_net_url_swap(git_net_url *a, git_net_url *b);
4848/** Places the URL into the given buffer. */
4949extern int git_net_url_fmt (git_buf * out , git_net_url * url );
5050
51+ /** Place the path and query string into the given buffer. */
52+ extern int git_net_url_fmt_path (git_buf * buf , git_net_url * url );
53+
5154/** Disposes the contents of the structure. */
5255extern void git_net_url_dispose (git_net_url * url );
5356
You can’t perform that action at this time.
0 commit comments