commit - 1a36436d4d4024fada20498cad3039950c4b2da2
commit + a484d721b0152ab353a510e75b2aab3cd1aebee3
blob - 96fece4634c0766c9a3aaef60f3df693fc56fc11
blob + 01f304f9b44e4b62576f8d26aca2b3756f8d99b0
--- got/got.c
+++ got/got.c
checkout_progress(void *arg, unsigned char status, const char *path)
{
char *worktree_path = arg;
+
+ /* Base commit bump happens silently. */
+ if (status == GOT_STATUS_BUMP_BASE)
+ return;
while (path[0] == '/')
path++;
return;
*did_something = 1;
+
+ /* Base commit bump happens silently. */
+ if (status == GOT_STATUS_BUMP_BASE)
+ return;
+
while (path[0] == '/')
path++;
printf("%c %s\n", status, path);
blob - 6ab8418c059fa507bf8dfbb1f840b9f94d47a5d3
blob + 2dd6e8cfae54c6bc3ebc6d27f919785066d57529
--- include/got_worktree.h
+++ include/got_worktree.h
#define GOT_STATUS_OBSTRUCTED '~'
#define GOT_STATUS_REVERT 'R'
#define GOT_STATUS_CANNOT_DELETE 'd'
+#define GOT_STATUS_BUMP_BASE 'b'
/*
* Attempt to initialize a new work tree on disk.
blob - acc38bf248e0148b45afacb9d4c7f2ae7db08b60
blob + d541a30b5fbfe09481bfcf827b523db052fb9afb
--- lib/worktree.c
+++ lib/worktree.c
const char *path;
size_t path_len;
const char *entry_name;
+ got_worktree_checkout_cb progress_cb;
+ void *progress_arg;
};
/* Bump base commit ID of all files within an updated part of the work tree. */
} else if (!got_path_is_child(ie->path, a->path, a->path_len))
return NULL;
+ (*a->progress_cb)(a->progress_arg, GOT_STATUS_BUMP_BASE, ie->path);
memcpy(ie->commit_sha1, a->base_commit_id->sha1, SHA1_DIGEST_LENGTH);
return NULL;
}
bbc_arg.entry_name = entry_name;
bbc_arg.path = path;
bbc_arg.path_len = strlen(path);
+ bbc_arg.progress_cb = progress_cb;
+ bbc_arg.progress_arg = progress_arg;
err = got_fileindex_for_each_entry_safe(fileindex,
bump_base_commit_id, &bbc_arg);
sync:
blob - 07a2d33972a8a0313ab84aa837a7724d06cc13bc
blob + ce179b0abdbeedd05c12868f359472f1a1517349
--- regress/cmdline/update.sh
+++ regress/cmdline/update.sh
(cd $testroot/wt && got update > $testroot/stdout)
- echo "Already up-to-date" > $testroot/stdout.expected
+ echo -n "Updated to commit " >> $testroot/stdout.expected
+ git_show_head $testroot/repo >> $testroot/stdout.expected
+ echo >> $testroot/stdout.expected
cmp -s $testroot/stdout.expected $testroot/stdout
ret="$?"
if [ "$ret" != "0" ]; then