worktree move: accept destination as directory
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 <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
9f792bb472
commit
c64a8d200f
3
strbuf.h
3
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.
|
||||
|
Reference in New Issue
Block a user