From c64a8d200f4109df86c6d4716ea4da58df450e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Mon, 12 Feb 2018 16:49:37 +0700 Subject: worktree move: accept destination as directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Similar to "mv a b/", which is actually "mv a b/a", we extract basename of source worktree and create a directory of the same name at destination if dst path is a directory. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- strbuf.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 14c8c10d66..e6cae5f439 100644 --- a/strbuf.h +++ b/strbuf.h @@ -179,6 +179,9 @@ extern void strbuf_trim(struct strbuf *); extern void strbuf_rtrim(struct strbuf *); extern void strbuf_ltrim(struct strbuf *); +/* Strip trailing directory separators */ +extern void strbuf_trim_trailing_dir_sep(struct strbuf *); + /** * Replace the contents of the strbuf with a reencoded form. Returns -1 * on error, 0 on success. -- cgit v1.2.3