Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks when a directory exists without git subtree #15

Open
aminvakil opened this issue Jan 8, 2021 · 0 comments
Open

Breaks when a directory exists without git subtree #15

aminvakil opened this issue Jan 8, 2021 · 0 comments

Comments

@aminvakil
Copy link
Contributor

When there is already a folder containing a package with the name of pkgname, it will break as it thinks it has already been included.

aurpublish/aurpublish.in

Lines 142 to 148 in 11aeeaa

# test if prefix already exists
if is_package_in_git ${package}; then
git subtree split -P "${package}" --rejoin
git subtree pull -P "${package}" aur:${pkgbase}.git master -m "Merge subtree '${package}'"
else
git subtree add -P "${package}" aur:${package}.git master
fi

Can't is_package_in_git improve to check this too?

aurpublish/aurpublish.in

Lines 47 to 49 in 11aeeaa

is_package_in_git() {
git ls-tree -d --name-only HEAD | grep -qxF "${1}"
}

I have found this command to check configured git subtrees: git log | grep git-subtree-dir | tr -d ' ' | cut -d ":" -f2 | sort | uniq, but it will already break if subtree has been added and folder removed later, so I'm not sure about this.

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

No branches or pull requests

1 participant