From: Richard Hartmann Date: Sun, 29 Nov 2015 16:59:08 +0000 (+0100) Subject: Merge pull request #179 from dottedmag/master X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/9d67671f8cdb7786fe833c665e016d02dbe3ce31?ds=inline;hp=-c Merge pull request #179 from dottedmag/master Fix broken list-tracked-by -- list_tracked expects repository at $2 --- 9d67671f8cdb7786fe833c665e016d02dbe3ce31 diff --combined vcsh index e339cde,d9877b9..9a5d5e0 --- a/vcsh +++ b/vcsh @@@ -264,7 -264,7 +264,7 @@@ list_tracked_helper() } list_tracked_by() { - list_tracked $2 + list_tracked '' $2 } list_untracked() { @@@ -425,14 -425,12 +425,14 @@@ use() } which() { - [ -e "$VCSH_COMMAND_PARAMETER" ] || fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 - for VCSH_REPO_NAME in $(list); do - for VCSH_FILE in $(get_files); do - echo "$VCSH_FILE" | grep -q "$VCSH_COMMAND_PARAMETER" && echo "$VCSH_REPO_NAME: $VCSH_FILE" - done - done | sort -u + output=$(for VCSH_REPO_NAME in $(list); do + get_files | grep -- "$VCSH_COMMAND_PARAMETER" | sed "s/^/$VCSH_REPO_NAME: /" + done | sort -u) + if [ -z "$output" ]; then + fatal "'$VCSH_COMMAND_PARAMETER' does not exist" 1 + else + echo "$output" + fi } write_gitignore() {