diff --git a/libexec/sourcezap/utils/git-changed-files b/libexec/sourcezap/utils/git-changed-files index 6a84d79..4624d3d 100755 --- a/libexec/sourcezap/utils/git-changed-files +++ b/libexec/sourcezap/utils/git-changed-files @@ -10,15 +10,13 @@ commit=$2 ## # functions -gitexec() +diff() { - "${libexec}"/utils/gitexec "${1}" + "${libexec}"/utils/gitdiff ${@} } ## # main cd "${gitdir}" -add=$(gitexec "diff --name-only --diff-filter=A ${commit} HEAD") -mod=$(gitexec "diff --name-only --diff-filter=M ${commit} HEAD") -echo "${add}" -echo "${mod}" +diff "--name-only" "--diff-filter=A" "${commit}" "HEAD" +diff "--name-only" "--diff-filter=M" "${commit}" "HEAD" diff --git a/libexec/sourcezap/utils/git-removed-files b/libexec/sourcezap/utils/git-removed-files index 21ff236..6531505 100755 --- a/libexec/sourcezap/utils/git-removed-files +++ b/libexec/sourcezap/utils/git-removed-files @@ -10,12 +10,12 @@ commit=$2 ## # functions -gitexec() +diff() { - "${libexec}"/utils/gitexec "${1}" + "${libexec}"/utils/gitdiff ${@} } ## # main cd "${gitdir}" -gitexec "diff --name-only --diff-filter=D ${commit} HEAD" +diff "--name-only" "--diff-filter=D" "${commit}" "HEAD" diff --git a/libexec/sourcezap/utils/gitdiff b/libexec/sourcezap/utils/gitdiff new file mode 100755 index 0000000..52a3ee4 --- /dev/null +++ b/libexec/sourcezap/utils/gitdiff @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +## +# variables +localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} +libexec="${localbase}"/libexec/sourcezap + +## +# main +"${libexec}"/utils/gitexec diff -l0 ${@}