You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with 5.3.0 the NoFetch argument remains set false when GitVersion is being invoked without arguments. This is because the ParseArguments function checks at the beginning whether it was invoked without any arguments and then just sets some default values.
Expected Behavior
In my opinion all arguments should be set to the same value they would be set if GitVersion was invoked with at least one argument. E.g. if GitVersion is called only with parameter targetpath, NoFetch would be inferred from the buildAgent. If called without any parameters at all NoFetch would be set to false no matter what the build agents PreventFetch method says. This also applies to other parameters, e.g. the authentication would not be derived from the environment vars in case GitVersion is invoked without any arguments
Actual Behavior
Currently NoFetchremains false even if the buildagents PreventFetch function returns true when GitVersionis invoked without any arguments
Possible Fix
Remove the zero-arguments check at the beginning of the ParseArguments function. I will provide a pull request if welcome
Steps to Reproduce
invoke on a build server environment (e.g. environment variables TEAMCITY_VERSION and Git_Branch exist) one time without any arguments and the other time with unrelated argument e.g. target path and see how NoFetch is falsein the one case and true in the other.
Context
Updated from 5.2 to 5.5 and GitVersion suddenly failed because it tried to fetch data from remote
Your Environment
TeamCity 2020.1
The text was updated successfully, but these errors were encountered:
Starting with 5.3.0 the
NoFetch
argument remains set false whenGitVersion
is being invoked without arguments. This is because theParseArguments
function checks at the beginning whether it was invoked without any arguments and then just sets some default values.Expected Behavior
In my opinion all arguments should be set to the same value they would be set if
GitVersion
was invoked with at least one argument. E.g. ifGitVersion
is called only with parametertargetpath
,NoFetch
would be inferred from the buildAgent. If called without any parameters at allNoFetch
would be set tofalse
no matter what the build agentsPreventFetch
method says. This also applies to other parameters, e.g. the authentication would not be derived from the environment vars in caseGitVersion
is invoked without any argumentsActual Behavior
Currently
NoFetch
remainsfalse
even if the buildagentsPreventFetch
function returnstrue
whenGitVersion
is invoked without any argumentsPossible Fix
Remove the zero-arguments check at the beginning of the
ParseArguments
function. I will provide a pull request if welcomeSteps to Reproduce
invoke on a build server environment (e.g. environment variables TEAMCITY_VERSION and Git_Branch exist) one time without any arguments and the other time with unrelated argument e.g. target path and see how
NoFetch
isfalse
in the one case andtrue
in the other.Context
Updated from 5.2 to 5.5 and
GitVersion
suddenly failed because it tried to fetch data from remoteYour Environment
TeamCity 2020.1
The text was updated successfully, but these errors were encountered: