Allow for optional <name> argument in feature diffs. (No name uses the "current" feature branch.)
This commit is contained in:
parent
b03cf963fc
commit
11b1f41a36
1 changed files with 11 additions and 1 deletions
|
@ -328,7 +328,17 @@ cmd_track() {
|
||||||
|
|
||||||
cmd_diff() {
|
cmd_diff() {
|
||||||
parse_args "$@"
|
parse_args "$@"
|
||||||
|
CURRENT_BRANCH=$(git branch | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
|
||||||
|
if [ "$NAME" != "" ]; then
|
||||||
expand_name_arg_prefix
|
expand_name_arg_prefix
|
||||||
|
elif [ "$CURRENT_BRANCH" != "" ]; then
|
||||||
|
BRANCH="$CURRENT_BRANCH"
|
||||||
|
else
|
||||||
|
warn "The current HEAD is no feature branch."
|
||||||
|
warn "To diff a feature, specify a <name> argument."
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# TODO: if this feature has been based on a non-develop branch, we really
|
# TODO: if this feature has been based on a non-develop branch, we really
|
||||||
# should not be comparing to $DEVELOP. How to deal with this?
|
# should not be comparing to $DEVELOP. How to deal with this?
|
||||||
|
|
Loading…
Reference in a new issue