Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
worktree: move delete_git_dir() earlier in file for upcoming new callers
author
Eric Sunshine
<sunshine@sunshineco.com>
Tue, 28 Aug 2018 21:20:19 +0000
(17:20 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 30 Aug 2018 16:28:02 +0000
(09:28 -0700)
This is a pure code movement to avoid having to forward-declare the
function when new callers are subsequently added.
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
4c5fa9e
)
diff --git
a/builtin/worktree.c
b/builtin/worktree.c
index 41e7714396dc3334bcb29f2454d210d63a649243..a8128289cce78a007ee8adf94b51e6989ce35191 100644
(file)
--- a/
builtin/worktree.c
+++ b/
builtin/worktree.c
@@
-47,6
+47,20
@@
static int git_worktree_config(const char *var, const char *value, void *cb)
return git_default_config(var, value, cb);
}
return git_default_config(var, value, cb);
}
+static int delete_git_dir(struct worktree *wt)
+{
+ struct strbuf sb = STRBUF_INIT;
+ int ret = 0;
+
+ strbuf_addstr(&sb, git_common_path("worktrees/%s", wt->id));
+ if (remove_dir_recursively(&sb, 0)) {
+ error_errno(_("failed to delete '%s'"), sb.buf);
+ ret = -1;
+ }
+ strbuf_release(&sb);
+ return ret;
+}
+
static int prune_worktree(const char *id, struct strbuf *reason)
{
struct stat st;
static int prune_worktree(const char *id, struct strbuf *reason)
{
struct stat st;
@@
-822,20
+836,6
@@
static int delete_git_work_tree(struct worktree *wt)
return ret;
}
return ret;
}
-static int delete_git_dir(struct worktree *wt)
-{
- struct strbuf sb = STRBUF_INIT;
- int ret = 0;
-
- strbuf_addstr(&sb, git_common_path("worktrees/%s", wt->id));
- if (remove_dir_recursively(&sb, 0)) {
- error_errno(_("failed to delete '%s'"), sb.buf);
- ret = -1;
- }
- strbuf_release(&sb);
- return ret;
-}
-
static int remove_worktree(int ac, const char **av, const char *prefix)
{
int force = 0;
static int remove_worktree(int ac, const char **av, const char *prefix)
{
int force = 0;