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
When a repo is initialized, if the profile creation failed, gut won't work.
Sorry, I can't check if the HEAD is detached 😢
Error message: reference not found
Potential origin
funcInit(cmd*cobra.Command, args []string) {
wd, err:=os.Getwd()
iferr!=nil {
exitOnError("Oups, something went wrong while getting the current working directory", err)
}
ifexecutor.IsPathGitRepo(wd) {
exitOnError("Oups, this directory is already a git repository. Delete the .git folder if you want to initialize a new repository", nil)
}
err=executor.Init(wd)
iferr!=nil {
exitOnError("Oups, something went wrong while initializing the repository", err)
}
profile:=selectProfile("", true)
associateProfileToPath(profile, wd)
_, err=executor.Commit(wd, "🎉 Initial commit from Gut")
iferr!=nil {
exitOnError("Oups, something went wrong while creating the first commit", err)
}
print.Message("Yeah, your repository is ready to go!", print.Success)
}
This is the function for the command Init in gut.
If selectProfile failed (e.g. pass ins't installed), no initial commit is made ( executor.Commit() is never called).
However, the repo is initialised.
When gut checks if the repo is in detached head, it fails because there isn't any commit (so no HEAD)
The text was updated successfully, but these errors were encountered:
If profile initialisation fails on a new repo, a repo would be initialised.
However, no commit would be made.
This lead to issue when gut tries to figured out the HEAD. It couldn't because there isn't any commits.
To solve this issue, initialisation of a git repo is now made after the profile selection. If selection fails, it exits.
Therefore, the repo won't be left in a state initialised but without any commits
When a repo is initialized, if the profile creation failed, gut won't work.
Potential origin
This is the function for the command
Init
in gut.If selectProfile failed (e.g. pass ins't installed), no initial commit is made (
executor.Commit()
is never called).However, the repo is initialised.
When gut checks if the repo is in detached head, it fails because there isn't any commit (so no HEAD)
The text was updated successfully, but these errors were encountered: