summaryrefslogtreecommitdiff
path: root/fi-prune-empty2/stream.go
diff options
context:
space:
mode:
Diffstat (limited to 'fi-prune-empty2/stream.go')
-rw-r--r--fi-prune-empty2/stream.go24
1 files changed, 23 insertions, 1 deletions
diff --git a/fi-prune-empty2/stream.go b/fi-prune-empty2/stream.go
index da4b7be..be36d54 100644
--- a/fi-prune-empty2/stream.go
+++ b/fi-prune-empty2/stream.go
@@ -357,7 +357,29 @@ func (h *Handler) CmdReset(cmd libfastimport.CmdReset) error {
}
func (h *Handler) CmdTag(cmd libfastimport.CmdTag) error {
cmd.CommitIsh = h.driver.FixCommitIsh(cmd.CommitIsh)
- return h.backend.Do(cmd)
+
+ // emit the tag
+ if err := h.backend.Do(cmd); err != nil {
+ return err
+ }
+
+ // tell the driver about the emitted tag
+ sha1, err := h.backend.GetMark(libfastimport.CmdGetMark{
+ Mark: cmd.Mark,
+ })
+ if err != nil {
+ return err
+ }
+ hash, err := AsHash(sha1)
+ if err != nil {
+ return err
+ }
+ h.driver.GotMark(Mark(cmd.Mark), hash)
+
+ // remember the tag
+ h.refs[cmd.RefName] = Mark(cmd.Mark)
+
+ return nil
}
func (h *Handler) CmdCatBlob(cmd libfastimport.CmdCatBlob) (sha1 string, data string, err error) {