Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/lib/util
diff options
context:
space:
mode:
authorLevente Polyak <anthraxx@archlinux.org>2023-01-14 18:20:29 +0100
committerLevente Polyak <anthraxx@archlinux.org>2023-05-20 00:08:11 +0200
commit1d7f9972151b0a52297880c8f9e5f28a1d7fe597 (patch)
treec33829e2d30756d219ea470b07abbabd76f899d0 /src/lib/util
parent79543824011ba51ddad6a4dda8c8c585ea8e5e0a (diff)
build: command to build packages inside a clean chroot
Diffstat (limited to 'src/lib/util')
-rw-r--r--src/lib/util/git.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/lib/util/git.sh b/src/lib/util/git.sh
new file mode 100644
index 0000000..c4af662
--- /dev/null
+++ b/src/lib/util/git.sh
@@ -0,0 +1,24 @@
+#!/hint/bash
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+[[ -z ${DEVTOOLS_INCLUDE_UTIL_GIT_SH:-} ]] || return 0
+DEVTOOLS_INCLUDE_UTIL_GIT_SH=1
+
+_DEVTOOLS_LIBRARY_DIR=${_DEVTOOLS_LIBRARY_DIR:-@pkgdatadir@}
+
+
+git_diff_tree() {
+ local commit=$1
+ local path=$2
+ git \
+ --no-pager \
+ diff \
+ --color=never \
+ --color-moved=no \
+ --unified=0 \
+ --no-prefix \
+ --no-ext-diff \
+ "${commit}" \
+ -- "${path}"
+}