From: Richard Hartmann Date: Sun, 29 Nov 2015 21:02:35 +0000 (+0100) Subject: Merge branch 'feature/opt-list_untracked-a' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/195dd8c17928cddb92bce06182631cbd0d82f4af?hp=6d3e9d21d1bfa0a024bbf5758c6f6e55086deac8 Merge branch 'feature/opt-list_untracked-a' --- diff --git a/t/100-init.t b/t/100-init.t index f8cb5ef..80a10c9 100644 --- a/t/100-init.t +++ b/t/100-init.t @@ -25,7 +25,6 @@ ok $output eq "test1:\n\n", 'Our new repo is there'; chdir $ENV{"HOME"} . '/.config/vcsh/repo.d/test1.git/' or die $!; ok -f 'HEAD'; -ok -d 'branches'; ok -f 'config'; ok -f 'description'; ok -d 'hooks'; diff --git a/vcsh b/vcsh index 4da3547..afed6eb 100755 --- a/vcsh +++ b/vcsh @@ -170,7 +170,7 @@ clone() { [ x"$VCSH_CONFLICT" = x'1' ]) && fatal "will stop after fetching and not try to merge! Once this situation has been resolved, run 'vcsh $VCSH_REPO_NAME pull' to finish cloning." 17 - git merge origin/"$VCSH_BRANCH" + git -c merge.ff=true merge origin/"$VCSH_BRANCH" hook post-merge hook post-clone retire @@ -265,7 +265,7 @@ list_tracked_helper() { } list_tracked_by() { - list_tracked $2 + list_tracked '' $2 } list_untracked() { @@ -429,12 +429,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() {