Skip to content

stg export errors out when exporting a series that contains an empty patch #112

Closed
@agotsis

Description

@agotsis

rep.sh

#!/bin/bash

set -ex
# cleanup
rm -rf test export

mkdir test export && cd test

echo "hello" > file.txt

git init && git add file.txt && git commit -m "Initial commit"

stg init

# create a non-empty patch
echo "world" >> file.txt
stg new p1 -m p1 && stg refresh

# create an empty patch
stg new p2 -m p2

# try to export the series
stg export -n -d ../export

## ERROR: ##
# error: unrecognized input
# stg export: git failed with code 128
# <choked on empty patch it seems>

## EXPECTED: ##
# <empty, patches exported>
$ ./rep.sh
+ rm -rf test export
+ mkdir test export
+ cd test
+ echo hello
+ git init
Initialized empty Git repository in /home/agotsis/test/.git/
+ git add file.txt
+ git commit -m 'Initial commit'
[master (root-commit) f1a0559] Initial commit
 1 file changed, 1 insertion(+)
 create mode 100644 file.txt
+ stg init
+ echo world
+ stg new p1 -m p1
Now at patch "p1"
+ stg refresh
Now at patch "p1"
+ stg new p2 -m p2
Now at patch "p2"
+ stg export -n -d ../export
error: unrecognized input
stg export: git failed with code 128

$ ls export
01-p1  series

$ cat export/series
# This series applies on GIT commit f1a055946ffd00b5ed04d3e76106e3544f6d718a
01-p1
02-p2
$ stg -v
Stacked GIT 1.1
git version 2.28.0
Python version 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0]

$ git --version
git version 2.28.0

It would also appear that an empty patch in the middle has the same issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions