mirror of
https://github.com/ViViDboarder/abuse-the-force.git
synced 2024-11-24 13:36:31 +00:00
Update git-changed to better recognize single commits
This commit is contained in:
parent
3b4ea388d1
commit
c5897870bb
@ -5,6 +5,13 @@
|
|||||||
# Description: Simple command to generate lists of
|
# Description: Simple command to generate lists of
|
||||||
# changed files. Designed to work with AbuseTheForce
|
# changed files. Designed to work with AbuseTheForce
|
||||||
###############################
|
###############################
|
||||||
|
gitismerge () {
|
||||||
|
local sha=$1
|
||||||
|
msha=$(git rev-list --merges ${sha}...${sha}~1)
|
||||||
|
# If commit returned is the one passed it, it is a merge
|
||||||
|
[ -z "$msha" ] && return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
|
||||||
@ -21,7 +28,7 @@ if [ -z "$1" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# If there is only one parameter, return the files changed in that commit
|
# If there is only one parameter, return the files changed in that commit
|
||||||
if [ -z "$2" ]; then
|
if [ -z "$2" ] && gitismerge $1; then
|
||||||
git diff-tree --no-commit-id --name-only $1
|
git diff-tree --no-commit-id --name-only $1
|
||||||
else
|
else
|
||||||
git diff --no-commit-id --name-only $1 $2
|
git diff --no-commit-id --name-only $1 $2
|
||||||
|
Loading…
Reference in New Issue
Block a user