Skip to content

Commit

Permalink
magit-file-{ignore,tracked}-p: Convert filename for git
Browse files Browse the repository at this point in the history
Closes #4966.
  • Loading branch information
tarsius committed Jul 23, 2023
1 parent eba1e85 commit 2c2b34d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lisp/magit-files.el
Expand Up @@ -431,7 +431,7 @@ Git, fallback to using `rename-file'."
(user-error "%s already exists" dstfile))
(unless (file-exists-p dstdir)
(user-error "Destination directory %s does not exist" dstdir))
(if (magit-file-tracked-p (magit-convert-filename-for-git file))
(if (magit-file-tracked-p file)
(magit-call-git "mv"
(magit-convert-filename-for-git file)
(magit-convert-filename-for-git newname))
Expand Down
5 changes: 3 additions & 2 deletions lisp/magit-git.el
Expand Up @@ -1074,10 +1074,11 @@ tracked file."

(defun magit-file-ignored-p (file)
(magit-git-string-p "ls-files" "--others" "--ignored" "--exclude-standard"
"--" file))
"--" (magit-convert-filename-for-git file)))

(defun magit-file-tracked-p (file)
(magit-git-success "ls-files" "--error-unmatch" "--" file))
(magit-git-success "ls-files" "--error-unmatch"
"--" (magit-convert-filename-for-git file)))

(defun magit-list-files (&rest args)
(apply #'magit-git-items "ls-files" "-z" "--full-name" args))
Expand Down

0 comments on commit 2c2b34d

Please sign in to comment.