Skip to content

Commit

Permalink
Support older versions of git for subrep init
Browse files Browse the repository at this point in the history
Older versions of git require git config --get instead of
git config get. Newer versions support both methods so use the
most widely supported.

Fixes #631
  • Loading branch information
admorgan committed Sep 9, 2024
1 parent 55a050a commit 57de7d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/git-subrepo
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ command:clone() {
# `git subrepo init <subdir>` command:
command:init() {
command-setup +subdir
local default_branch=$(git config get --default=master init.defaultbranch)
local default_branch=
default_branch=$(git config --get --default=master init.defaultbranch)
local remote=${subrepo_remote:=none}
local branch=${subrepo_branch:=$default_branch}

Expand Down

0 comments on commit 57de7d6

Please sign in to comment.