From: Richard Hartmann Date: Sun, 29 Nov 2015 19:14:48 +0000 (+0100) Subject: Merge pull request #183 from ohspite/ff-initial-merge X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/cf9bd27d5bcbecf461b55acd76dbf57679e4a6b3?hp=eca56c3347364f2dbf754f4ffa871069a9f26c7d Merge pull request #183 from ohspite/ff-initial-merge vcsh: Always fast forward initial merge --- diff --git a/vcsh b/vcsh index 4ea3125..c30b12d 100755 --- a/vcsh +++ b/vcsh @@ -264,7 +264,7 @@ list_tracked_helper() { } list_tracked_by() { - list_tracked $2 + list_tracked '' $2 } list_untracked() { @@ -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() {