aboutsummaryrefslogtreecommitdiff
path: root/libs/git
diff options
context:
space:
mode:
Diffstat (limited to 'libs/git')
-rwxr-xr-xlibs/git21
1 files changed, 13 insertions, 8 deletions
diff --git a/libs/git b/libs/git
index 358d5d1f..104239c1 100755
--- a/libs/git
+++ b/libs/git
@@ -210,9 +210,19 @@ git_patch() {
export GIT_COMMITTER_EMAIL=$GIT_EMAIL
cd "$repository_path"
- git checkout "$branch" 2> /dev/null > /dev/null
+ git checkout "$branch" >/dev/null 2>&1
- git am "$patch" || git am --abort
+ case $patch in
+ *.patch)
+ git am "$patch" || git am --abort
+ ;;
+ *.diff)
+ git_apply "$repository_path" "$branch" "$patch" &&
+ git_commit "$repository_path" "Applied ${patch##*/}"
+ ;;
+ *)
+ ;;
+ esac
)
}
@@ -277,12 +287,7 @@ git_project_patch_recursive() {
fi
for patch in "$patches_path"/[!.]*.@(patch|diff); do
- if [[ ${patch##*.} == patch ]]; then
- git_patch "$repository_path" "$branch" "$patch"
- else
- git_apply "$repository_path" "$branch" "$patch"
- git_commit "$repository_path" "Applied ${patch##*/}"
- fi
+ git_patch "$repository_path" "$branch" "$patch"
done
}