Support repo change between invocations
main logic from PR 499 (v3) from sed-i
This commit is contained in:
parent
b3a261c673
commit
f1e698e225
|
|
@ -928,7 +928,7 @@ func (git *repoSync) AddWorktreeAndSwap(ctx context.Context, hash string) error
|
||||||
if git.branch != "" {
|
if git.branch != "" {
|
||||||
fetch = git.branch
|
fetch = git.branch
|
||||||
}
|
}
|
||||||
args = append(args, "origin", fetch)
|
args = append(args, git.repo, fetch)
|
||||||
|
|
||||||
// Update from the remote.
|
// Update from the remote.
|
||||||
if _, err := git.run.Run(ctx, git.root, nil, git.cmd, args...); err != nil {
|
if _, err := git.run.Run(ctx, git.root, nil, git.cmd, args...); err != nil {
|
||||||
|
|
@ -1200,7 +1200,7 @@ func (git *repoSync) LocalHashForRev(ctx context.Context, rev string) (string, e
|
||||||
|
|
||||||
// RemoteHashForRef returns the upstream hash for a given ref.
|
// RemoteHashForRef returns the upstream hash for a given ref.
|
||||||
func (git *repoSync) RemoteHashForRef(ctx context.Context, ref string) (string, error) {
|
func (git *repoSync) RemoteHashForRef(ctx context.Context, ref string) (string, error) {
|
||||||
output, err := git.run.Run(ctx, git.root, nil, git.cmd, "ls-remote", "-q", "origin", ref)
|
output, err := git.run.Run(ctx, git.root, nil, git.cmd, "ls-remote", "-q", git.repo, ref)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue