Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Desambiguate revisions and files when invoking git #1829

Merged

Conversation

2opremio
Copy link
Contributor

User Git repositories may use the same name for:

  • A file and a branch used by Flux
  • A file and the tag used by Flux for syncing

For instance:

ts=2019-03-13T19:36:40.432679542Z caller=loop.go:90 component=sync-loop err="fatal: ambiguous argument 'staging': both revision and filename"

(See https://weave-community.slack.com/archives/C4U5ATZ9S/p1552505808477700?thread_ts=1552504490.476100&cid=C4U5ATZ9S )

This change removes that ambiguity by appending -- at the right places when invoking git.

In a few cases we were only appending it when adding files at the end, which wasn't correct.

User Git repositories may use the same name for:
* A file and a branch used by Flux
* A file and the tag used by Flux for syncing

For instance:
```
ts=2019-03-13T19:36:40.432679542Z caller=loop.go:90 component=sync-loop err="fatal: ambiguous argument 'staging': both revision and filename"
```

(See https://weave-community.slack.com/archives/C4U5ATZ9S/p1552505808477700?thread_ts=1552504490.476100&cid=C4U5ATZ9S )

This change removes that ambiguity by appending `--` at the right places when invoking `git`.

In a few cases we were only appending it when adding files at the end, which wasn't correct.
Copy link
Member

@hiddeco hiddeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting on what the tests say but this looks good, thanks a million Fons 🌟

@2opremio 2opremio merged commit 93cbed5 into fluxcd:master Mar 14, 2019
@2opremio 2opremio deleted the git-desambiguate-revisions-and-files branch March 14, 2019 15:56
@ellieayla
Copy link
Contributor

Good catch, @dcondomitti. A lot of people probably got lucky with their choice of filenames vs refs here.

@dcondomitti
Copy link

Thanks for the quick fix! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants