Skip to content

Commit 32718b6

Browse files
James BottomleyLinus Torvalds
authored andcommitted
[PATCH] checkout-cache: add "-n" option
This adds the "-n" option to checkout-cache which tells it to not check out new files, only refresh files already checked out. Signed-off-by: Linus Torvalds <[email protected]>
1 parent 235ac40 commit 32718b6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

checkout-cache.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
#include "cache.h"
3636

37-
static int force = 0, quiet = 0;
37+
static int force = 0, quiet = 0, not_new = 0;
3838

3939
static void create_directories(const char *path)
4040
{
@@ -118,7 +118,8 @@ static int checkout_entry(struct cache_entry *ce, const char *base_dir)
118118
* just do the right thing)
119119
*/
120120
unlink(path);
121-
}
121+
} else if (not_new)
122+
return 0;
122123
return write_entry(ce, path);
123124
}
124125

@@ -182,6 +183,10 @@ int main(int argc, char **argv)
182183
quiet = 1;
183184
continue;
184185
}
186+
if (!strcmp(arg, "-n")) {
187+
not_new = 1;
188+
continue;
189+
}
185190
if (!memcmp(arg, "--prefix=", 9)) {
186191
base_dir = arg+9;
187192
continue;

0 commit comments

Comments
 (0)