From b4281d0b0efb8cddcdfd7228184ce169a0ae49e6 Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Wed, 23 Jun 2021 09:51:43 +0200 Subject: [PATCH 1/2] Fix list_has_remote() Fixes https://github.com/RichiH/vcsh/issues/305 $VCSH_BRANCH was not set in list_has_remote() but required. This broke both `vcsh push` and `vcsh pull`. Signed-off-by: Richard Hartmann --- vcsh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcsh.in b/vcsh.in index 5e35ec93..f5ae6f4e 100755 --- a/vcsh.in +++ b/vcsh.in @@ -320,7 +320,9 @@ list() { list_has_remote() { for VCSH_REPO_NAME in $(list); do GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR - @GIT@ config branch."$VCSH_BRANCH".remote > /dev/null && echo "$VCSH_REPO_NAME" + # This command returns the tracking branch of the currently-checked-out local + # branch, if any. See https://stackoverflow.com/a/9753364 + [ -n "$(git for-each-ref "$(git symbolic-ref -q HEAD)")" ] && echo "$VCSH_REPO_NAME" done } From a330322528793d31591768268b194568ddc66123 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Wed, 23 Jun 2021 15:56:08 +0300 Subject: [PATCH 2/2] Use configure to set paths to system executables --- vcsh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcsh.in b/vcsh.in index f5ae6f4e..57542989 100755 --- a/vcsh.in +++ b/vcsh.in @@ -322,7 +322,7 @@ list_has_remote() { GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR # This command returns the tracking branch of the currently-checked-out local # branch, if any. See https://stackoverflow.com/a/9753364 - [ -n "$(git for-each-ref "$(git symbolic-ref -q HEAD)")" ] && echo "$VCSH_REPO_NAME" + [ -n "$(@GIT@ for-each-ref "$(@GIT@ symbolic-ref -q HEAD)")" ] && echo "$VCSH_REPO_NAME" done }