aboutsummaryrefslogtreecommitdiff
path: root/cmake/Format.cmake
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:40:55 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:40:55 +0000
commit0bd3cd90d902a1419db129427980ad7af1650d50 (patch)
tree2554d10989c0387909d002f41ecbf380dd431b8b /cmake/Format.cmake
parent4cb64e3b084995a0924d521e89c3e341e2200a6a (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-0bd3cd90d902a1419db129427980ad7af1650d50.tar.gz
rneovim-0bd3cd90d902a1419db129427980ad7af1650d50.tar.bz2
rneovim-0bd3cd90d902a1419db129427980ad7af1650d50.zip
Merge remote-tracking branch 'upstream/master' into fix_20726
Diffstat (limited to 'cmake/Format.cmake')
-rw-r--r--cmake/Format.cmake10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmake/Format.cmake b/cmake/Format.cmake
index 4115e66705..7097e5766f 100644
--- a/cmake/Format.cmake
+++ b/cmake/Format.cmake
@@ -1,35 +1,33 @@
# Returns a list of all files that has been changed in current branch compared
# to master branch. This includes unstaged, staged and committed files.
function(get_changed_files outvar)
- set(default_branch master)
-
execute_process(
COMMAND git branch --show-current
OUTPUT_VARIABLE current_branch
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
- COMMAND git merge-base ${default_branch} ${current_branch}
+ COMMAND git merge-base master HEAD
OUTPUT_VARIABLE ancestor_commit
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Changed files that have been committed
execute_process(
- COMMAND git diff --name-only ${ancestor_commit}...${current_branch}
+ COMMAND git diff --diff-filter=d --name-only ${ancestor_commit}...${current_branch}
OUTPUT_VARIABLE committed_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(committed_files NATIVE_COMMAND ${committed_files})
# Unstaged files
execute_process(
- COMMAND git diff --name-only
+ COMMAND git diff --diff-filter=d --name-only
OUTPUT_VARIABLE unstaged_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(unstaged_files NATIVE_COMMAND ${unstaged_files})
# Staged files
execute_process(
- COMMAND git diff --cached --name-only
+ COMMAND git diff --diff-filter=d --cached --name-only
OUTPUT_VARIABLE staged_files
OUTPUT_STRIP_TRAILING_WHITESPACE)
separate_arguments(staged_files NATIVE_COMMAND ${staged_files})