We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6597914 commit 5da7e35Copy full SHA for 5da7e35
pkg/gitutil/git.go
@@ -47,7 +47,12 @@ func IsGitCloned(gitPath string) (bool, error) {
47
48
// update will fetch origin and set HEAD to origin/HEAD.
49
func update(destinationPath string) error {
50
- return exec(destinationPath, "pull", "--ff-only", "-v")
+ if err := exec(destinationPath, "fetch", "-v"); err != nil {
51
+ return errors.Wrapf(err, "fetch index at %q failed", destinationPath)
52
+ }
53
+
54
+ err := exec(destinationPath, "reset", "--hard", "@{upstream}")
55
+ return errors.Wrapf(err, "reset index at %q failed", destinationPath)
56
}
57
58
// EnsureUpdated will ensure the destination path exists and is up to date.
0 commit comments