commit - 32e06003d38cf6936216808a0382ca5c8dd1bb95
commit + a3df2849ff6ef714618aee3003e83b56282dbb49
blob - 26f0c87b2ccfe16cfafd0822ef73fa849022b5ee
blob + 4cb95bfbcb19461364912743394029592eff2200
--- TODO
+++ TODO
- allow adding directory paths with 'got add'
- recursive addition: got add -R
- recursive removal: got rm -R
-- fix bug reproduced by xfail test 'test_commit_added_subdirs'
- in regress/cmdline/commit.sh
tog:
- allow loading new commits in 'tog log' after startup (e.g. via Ctrl-L, 'r')
blob - 38554a89939443afe975a7d181c7e5528eb8d42f
blob + 153a8c69767c3a930035bd8d69e616f6b18f485a
--- include/got_worktree.h
+++ include/got_worktree.h
#define GOT_STATUS_OBSTRUCTED '~'
#define GOT_STATUS_REVERT 'R'
+/* XXX TODO make this opaque */
struct got_commitable {
char *path;
char *in_repo_path;
struct got_object_id *base_blob_id;
struct got_object_id *base_commit_id;
mode_t mode;
+ int flags;
+#define GOT_COMMITABLE_ADDED 0x01
};
/*
blob - 7c7732c5ffc9aabbc1c18f30cbaaa200279534c7
blob + 8fe010595031738e026e47261c5708cd0a5f70cc
--- lib/worktree.c
+++ lib/worktree.c
struct got_commitable *ct = pe->data;
char *child_path = NULL, *slash;
- if (ct->status != GOT_STATUS_ADD)
+ if (ct->status != GOT_STATUS_ADD ||
+ (ct->flags & GOT_COMMITABLE_ADDED))
continue;
if (!got_path_is_child(pe->path, path_base_tree,
err = report_ct_status(ct, status_cb, status_arg);
if (err)
goto done;
+ ct->flags |= GOT_COMMITABLE_ADDED;
} else {
char *subtree_path;
- struct got_pathlist_entry *pe2;
- int visited = 0;
*slash = '\0'; /* trim trailing path components */
if (asprintf(&subtree_path, "%s%s%s", path_base_tree,
child_path) == -1) {
err = got_error_from_errno("asprintf");
goto done;
- }
- TAILQ_FOREACH(pe2, &paths, entry) {
- if (got_path_cmp(subtree_path, pe2->path) != 0)
- continue;
- visited = 1;
- break;
}
- if (visited) {
- free(subtree_path);
- continue;
- }
new_te = calloc(1, sizeof(*new_te));
new_te->mode = S_IFDIR;
blob - 454a2907eb42bfb61730e321b0e5e7d55abf7901
blob + 6ab0147a7a794f49cf1e8629bed73619f3d4c902
--- regress/cmdline/commit.sh
+++ regress/cmdline/commit.sh
> $testroot/stdout 2> $testroot/stderr)
local head_rev=`git_show_head $testroot/repo`
- echo "A d/f/new3" > $testroot/stdout.expected
- echo "A d/f/g/new4" >> $testroot/stdout.expected
+ echo "A d/f/g/new4" > $testroot/stdout.expected
+ echo "A d/f/new3" >> $testroot/stdout.expected
echo "A d/new" >> $testroot/stdout.expected
echo "A d/new2" >> $testroot/stdout.expected
echo "created commit $head_rev" >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then
- #diff -u $testroot/stdout.expected $testroot/stdout
- ret="xfail ($(head -n 1 $testroot/stderr))"
+ diff -u $testroot/stdout.expected $testroot/stdout
fi
test_done "$testroot" "$ret"
}