@@ -1415,25 +1415,25 @@ func (git *repoSync) publishSymlink(ctx context.Context, worktree worktree) erro
1415
1415
1416
1416
// Make sure the link directory exists.
1417
1417
if err := os .MkdirAll (linkDir , defaultDirMode ); err != nil {
1418
- return fmt .Errorf ("error making symlink dir: %v " , err )
1418
+ return fmt .Errorf ("error making symlink dir: %w " , err )
1419
1419
}
1420
1420
1421
1421
// newDir is absolute, so we need to change it to a relative path. This is
1422
1422
// so it can be volume-mounted at another path and the symlink still works.
1423
1423
targetRelative , err := filepath .Rel (linkDir , targetPath .String ())
1424
1424
if err != nil {
1425
- return fmt .Errorf ("error converting to relative path: %v " , err )
1425
+ return fmt .Errorf ("error converting to relative path: %w " , err )
1426
1426
}
1427
1427
1428
1428
const tmplink = "tmp-link"
1429
1429
git .log .V (2 ).Info ("creating tmp symlink" , "dir" , linkDir , "link" , tmplink , "target" , targetRelative )
1430
1430
if err := os .Symlink (targetRelative , filepath .Join (linkDir , tmplink )); err != nil {
1431
- return fmt .Errorf ("error creating symlink: %v " , err )
1431
+ return fmt .Errorf ("error creating symlink: %w " , err )
1432
1432
}
1433
1433
1434
1434
git .log .V (2 ).Info ("renaming symlink" , "root" , linkDir , "oldName" , tmplink , "newName" , linkFile )
1435
1435
if err := os .Rename (filepath .Join (linkDir , tmplink ), git .link .String ()); err != nil {
1436
- return fmt .Errorf ("error replacing symlink: %v " , err )
1436
+ return fmt .Errorf ("error replacing symlink: %w " , err )
1437
1437
}
1438
1438
1439
1439
return nil
@@ -1451,7 +1451,7 @@ func (git *repoSync) removeWorktree(ctx context.Context, worktree worktree) erro
1451
1451
}
1452
1452
git .log .V (1 ).Info ("removing worktree" , "path" , worktree .Path ())
1453
1453
if err := os .RemoveAll (worktree .Path ().String ()); err != nil {
1454
- return fmt .Errorf ("error removing directory: %v " , err )
1454
+ return fmt .Errorf ("error removing directory: %w " , err )
1455
1455
}
1456
1456
if _ , _ , err := git .Run (ctx , git .root , "worktree" , "prune" , "--verbose" ); err != nil {
1457
1457
return err
@@ -2045,7 +2045,7 @@ func (git *repoSync) SetupDefaultGitConfigs(ctx context.Context) error {
2045
2045
2046
2046
for _ , kv := range configs {
2047
2047
if _ , _ , err := git .Run (ctx , "" , "config" , "--global" , kv .key , kv .val ); err != nil {
2048
- return fmt .Errorf ("error configuring git %q %q: %v " , kv .key , kv .val , err )
2048
+ return fmt .Errorf ("error configuring git %q %q: %w " , kv .key , kv .val , err )
2049
2049
}
2050
2050
}
2051
2051
return nil
@@ -2056,12 +2056,12 @@ func (git *repoSync) SetupDefaultGitConfigs(ctx context.Context) error {
2056
2056
func (git * repoSync ) SetupExtraGitConfigs (ctx context.Context , configsFlag string ) error {
2057
2057
configs , err := parseGitConfigs (configsFlag )
2058
2058
if err != nil {
2059
- return fmt .Errorf ("can't parse --git-config flag: %v " , err )
2059
+ return fmt .Errorf ("can't parse --git-config flag: %w " , err )
2060
2060
}
2061
2061
git .log .V (1 ).Info ("setting additional git configs" , "configs" , configs )
2062
2062
for _ , kv := range configs {
2063
2063
if _ , _ , err := git .Run (ctx , "" , "config" , "--global" , kv .key , kv .val ); err != nil {
2064
- return fmt .Errorf ("error configuring additional git configs %q %q: %v " , kv .key , kv .val , err )
2064
+ return fmt .Errorf ("error configuring additional git configs %q %q: %w " , kv .key , kv .val , err )
2065
2065
}
2066
2066
}
2067
2067
@@ -2122,12 +2122,12 @@ func parseGitConfigs(configsFlag string) ([]keyVal, error) {
2122
2122
if r == '"' {
2123
2123
cur .val , err = parseGitConfigQVal (ch )
2124
2124
if err != nil {
2125
- return nil , fmt .Errorf ("key %q: %v " , cur .key , err )
2125
+ return nil , fmt .Errorf ("key %q: %w " , cur .key , err )
2126
2126
}
2127
2127
} else {
2128
2128
cur .val , err = parseGitConfigVal (r , ch )
2129
2129
if err != nil {
2130
- return nil , fmt .Errorf ("key %q: %v " , cur .key , err )
2130
+ return nil , fmt .Errorf ("key %q: %w " , cur .key , err )
2131
2131
}
2132
2132
}
2133
2133
}
0 commit comments