X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/9cf8f5c46b230abd912657aeac276e4a2ce38ce0..b40cd1a7fe1c45bd1f7f7f80802b157a41f97dfe:/vcsh diff --git a/vcsh b/vcsh index ff256da..d77f7cc 100755 --- a/vcsh +++ b/vcsh @@ -159,7 +159,12 @@ clone() { You should add files to your new repository." exit fi - git fetch origin "$VCSH_BRANCH" + GIT_VERSION_MAJOR=$(git --version | sed -n 's/.* \([0-9]\)\..*/\1/p' ) + if [ 2 -ge "$GIT_VERSION_MAJOR" ];then + git fetch origin "$VCSH_BRANCH" + else + git fetch origin + fi hook pre-merge git ls-tree -r --name-only origin/"$VCSH_BRANCH" | (while read object; do [ -e "$object" ] && @@ -169,7 +174,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 @@ -264,7 +269,7 @@ list_tracked_helper() { } list_tracked_by() { - list_tracked $2 + list_tracked '' $2 } list_untracked() { @@ -426,9 +431,7 @@ use() { which() { output=$(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 + 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