Commit 11b1f41a authored by Vincent Driessen's avatar Vincent Driessen

Allow for optional <name> argument in feature diffs. (No name uses the "current" feature branch.)

parent b03cf963
...@@ -328,7 +328,17 @@ cmd_track() { ...@@ -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?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment