Commit Graph

3 Commits

Author SHA1 Message Date
Aditya R b218fdf322
build: support building from commit when using git repo as build context
When using URL to a git repo as build context allow specifying `commit`
to make sure specific `commit` is used as the build context.

Examples

```console
buildah build -t test myrepo.git#abcef123
buildah build -t test myrepo.git#abcef123
buildah build -t test myrepo.git#abcef123:somesubdir
```
Closes: https://github.com/containers/buildah/issues/4148

Signed-off-by: Aditya R <arajan@redhat.com>
2022-08-03 18:50:44 +05:30
Nalin Dahyabhai 99488b06f6 build: clean up git repos correctly when using subdirs
When the build context is specified as a subdirectory in a Git
repository, we were cloning the repository to start, but only removing
the subdirectory when we were finished with it.  We should be removing
the whole clone.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-08-02 17:33:29 -04:00
Nalin Dahyabhai 6bfbed6bea bud.bats: use a local git daemon for the git protocol test
When testing that we can handle contexts that are described using the
git:// protocol, launch a local git-daemon with a minimal repository to
point the binary at instead of github, which doesn't do that any more.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-01-11 11:54:50 -05:00